Issue Details (XML | Word | Printable)

Key: CORE-3231
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Paul Vinkenoog
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

OVERLAY() fails when used with text BLOBs containing multi-byte chars

Created: 12/Nov/10 04:34 PM   Updated: 16/May/12 12:19 PM
Component/s: Engine
Affects Version/s: 2.1.3
Fix Version/s: 2.1.5

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
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.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Paul Vinkenoog added a comment - 10/Dec/10 04:25 PM - edited
After the experience with CORE-3262, I hoped that this one too would be auto-solved in 2.1.4

But alas, it's not (using build 18370). Same in 2.1.4 final.