8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 09:23:03 +01:00

Fixed CORE-1802 - Maximum key size using PXW_CSY collation

This commit is contained in:
asfernandes 2008-05-17 18:18:17 +00:00
parent 7bc95f13fc
commit ff80913a1b

View File

@ -105,17 +105,7 @@ USHORT LC_NARROW_key_length(texttype* obj, USHORT inLen)
{
BYTE bytesPerChar = 3;
// if collation is not multi-level, the weights used is already know
if (obj->texttype_impl->texttype_flags & TEXTTYPE_non_multi_level)
{
if (obj->texttype_impl->texttype_flags & TEXTTYPE_secondary_insensitive)
--bytesPerChar;
if (obj->texttype_impl->texttype_flags & TEXTTYPE_tertiary_insensitive)
--bytesPerChar;
}
else // scan the table to identify what weights are used
{
// scan the table to identify what weights are used
bool useSecondary = false;
bool useTertiary = false;
@ -136,6 +126,14 @@ USHORT LC_NARROW_key_length(texttype* obj, USHORT inLen)
if (!useTertiary)
--bytesPerChar;
if (obj->texttype_impl->texttype_flags & TEXTTYPE_non_multi_level)
{
if (useSecondary && (obj->texttype_impl->texttype_flags & TEXTTYPE_secondary_insensitive))
--bytesPerChar;
if (useTertiary && (obj->texttype_impl->texttype_flags & TEXTTYPE_tertiary_insensitive))
--bytesPerChar;
}
obj->texttype_impl->texttype_bytes_per_key = bytesPerChar;