The source code cited below clearly tells the root of the problem that I
reported.
The problem should be resolved by setting sortCollator's UCOL_STRENGTH
property as well as compareCollator.
There are two collater objects relating to this problem; Those are
sortCollator(*A) and compareCollator(*B). If the sorting is related to
unique-index, *B is used, otherwise *A. The strength is not given for *A
and remains as default. That means, for charset UTF8, the collate is
always UNICODE; CI and AI are ignored.
(UCOL_STRENGTH is given properly only for compareCollator)
https://github.com/Alexpux/firebird-git-svn/blob/master/src/common/unicode_util.cpp#L1334
if ((attributes & (TEXTTYPE_ATTR_CASE_INSENSITIVE |
TEXTTYPE_ATTR_ACCENT_INSENSITIVE)) ==
(TEXTTYPE_ATTR_CASE_INSENSITIVE | TEXTTYPE_ATTR_ACCENT_INSENSITIVE))
{
icu->ucolSetAttribute(compareCollator, UCOL_STRENGTH, UCOL_PRIMARY,
&status);
}
else if (attributes & TEXTTYPE_ATTR_CASE_INSENSITIVE)
icu->ucolSetAttribute(compareCollator, UCOL_STRENGTH, UCOL_SECONDARY,
&status);
(Selection of collator)
https://github.com/Alexpux/firebird-git-svn/blob/master/src/common/unicode_util.cpp#L1460
case INTL_KEY_UNIQUE:
coll = compareCollator;
srcLenLong *= sizeof(*src);
normalize(&srcLenLong, &src, true, buffer);
srcLenLong /= sizeof(*src);
break;
case INTL_KEY_SORT:
coll = sortCollator;
break;
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel