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

Fixed CORE-6056 - Overflow warings in some collations.

This commit is contained in:
Adriano dos Santos Fernandes 2019-05-10 12:21:29 -03:00
parent d2116ea145
commit b9b69d793d
2 changed files with 6 additions and 5 deletions

View File

@ -767,7 +767,7 @@ ULONG LC_NARROW_canonical(texttype* obj, ULONG srcLen, const UCHAR* src, ULONG d
if ((impl->texttype_flags & (TEXTTYPE_secondary_insensitive | TEXTTYPE_tertiary_insensitive)) == 0)
{
put(dst, (USHORT) ((primary << 8) | (coll->Secondary << 4) | coll->Tertiary));
put(dst, (USHORT) ((primary << 8) | (coll->Secondary << SortOrderTblEntrySecondaryBits) | coll->Tertiary));
}
else if ((impl->texttype_flags & TEXTTYPE_secondary_insensitive) == 0)
{

View File

@ -215,14 +215,15 @@
//-----------------------------------------------------------------
*/
struct SortOrderTblEntry {
static const unsigned SortOrderTblEntrySecondaryBits = 5;
struct SortOrderTblEntry {
// It's important that Secondary + Tertiary fits in a byte.
UINT16 Primary:8;
UINT16 Secondary:4;
UINT16 Tertiary:2;
UINT16 Secondary:5; // SortOrderTblEntrySecondaryBits
UINT16 Tertiary:3;
UINT16 IsExpand:1;
UINT16 IsCompress:1;
};
/*