You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OVERLAY() fails in 2.1.3 if either the string itself or the overlay is a BLOB which contains multi-byte characters.
This works:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set utf8) from rdb$database
)
select overlay (s placing cast('0123456789' as blob sub_type 1 character set utf8) from 5) from q
But this:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set utf8) from rdb$database
)
select overlay (s placing cast(_iso8859_1 'áé' as blob sub_type 1 character set utf8) from 5) from q
fails with 335544565 - 'Cannot transliterate character between character sets'
The same is true if not the overlay but the string itself contains a multi-byte character anywhere (even if it's way before or after the overlay position).
If the string with the multi-byte character(s) is a (VAR)CHAR, everything works correctly. The result may still be a BLOB with multi-byte chars.
There may be more going on, because even with single-byte accented characters:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set iso8859_1) from rdb$database
)
select overlay (s placing cast(_iso8859_1 'áé' as blob sub_type 1 character set iso8859_1) from 5) from q
the result is a 335544565 - 'Cannot transliterate character between character sets'
The connection character set was NONE in all examples.
Submitted by: @paulvink
Relate to QA458
OVERLAY() fails in 2.1.3 if either the string itself or the overlay is a BLOB which contains multi-byte characters.
This works:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set utf8) from rdb$database
)
select overlay (s placing cast('0123456789' as blob sub_type 1 character set utf8) from 5) from q
But this:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set utf8) from rdb$database
)
select overlay (s placing cast(_iso8859_1 'áé' as blob sub_type 1 character set utf8) from 5) from q
fails with 335544565 - 'Cannot transliterate character between character sets'
The same is true if not the overlay but the string itself contains a multi-byte character anywhere (even if it's way before or after the overlay position).
If the string with the multi-byte character(s) is a (VAR)CHAR, everything works correctly. The result may still be a BLOB with multi-byte chars.
There may be more going on, because even with single-byte accented characters:
with q(s) as (
select cast('abcdefghijklmno' as blob sub_type 1 character set iso8859_1) from rdb$database
)
select overlay (s placing cast(_iso8859_1 'áé' as blob sub_type 1 character set iso8859_1) from 5) from q
the result is a 335544565 - 'Cannot transliterate character between character sets'
The connection character set was NONE in all examples.
In 2.5, everthing works correctly.
Commits: 5350f53
The text was updated successfully, but these errors were encountered: