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

Fix #7243 - Some UNICODE characters can lead to wrong CONTAINING evaluation when lower/upper uses different number of bytes in its encoding.

This commit is contained in:
Adriano dos Santos Fernandes 2022-08-03 22:57:53 -03:00
parent 3ade7d95c6
commit 6d594b5ada

View File

@ -87,7 +87,10 @@ public:
UpcaseConverter(MemoryPool& pool, TextType* obj, const UCHAR*& str, SLONG& len)
: PrevConverter(pool, obj, str, len)
{
obj->str_to_upper(len, str, len, tempBuffer.getBuffer(len, false));
const auto charSet = obj->getCharSet();
const auto bufferSize = len / charSet->minBytesPerChar() * charSet->maxBytesPerChar();
len = obj->str_to_upper(len, str, bufferSize, tempBuffer.getBuffer(bufferSize, false));
str = tempBuffer.begin();
}