MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / INTL_key_length

Function INTL_key_length

src/jrd/intl.cpp:982–1020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

980
981
982USHORT INTL_key_length(thread_db* tdbb, USHORT idxType, USHORT iLength)
983{
984/**************************************
985 *
986 * I N T L _ k e y _ l e n g t h
987 *
988 **************************************
989 *
990 * Functional description
991 * Given an index type, and a maximum length (iLength)
992 * return the length of the byte string key descriptor to
993 * use when collating text of this type.
994 *
995 **************************************/
996 SET_TDBB(tdbb);
997
998 fb_assert(idxType >= idx_first_intl_string);
999
1000 const USHORT ttype = INTL_INDEX_TO_TEXT(idxType);
1001
1002 USHORT key_length;
1003 if (ttype <= ttype_last_internal)
1004 key_length = iLength;
1005 else
1006 {
1007 TextType* obj = INTL_texttype_lookup(tdbb, ttype);
1008 key_length = obj->key_length(iLength);
1009 }
1010
1011 // Validity checks on the computed key_length
1012
1013 if (key_length > MAX_KEY)
1014 key_length = MAX_KEY;
1015
1016 if (key_length < iLength)
1017 key_length = iLength;
1018
1019 return (key_length);
1020}
1021
1022
1023CharSet* INTL_charset_lookup(thread_db* tdbb, USHORT parm1)

Callers 4

BTR_key_lengthFunction · 0.85
initMethod · 0.85
generateSortMethod · 0.85

Calls 3

SET_TDBBFunction · 0.85
INTL_texttype_lookupFunction · 0.85
key_lengthMethod · 0.80

Tested by

no test coverage detected