Issue Details (XML | Word | Printable)

Key: CORE-3476
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

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

LIST function wrongly concatenates binary blobs

Created: 12/May/11 12:37 PM   Updated: 23/Sep/15 12:53 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0 Initial, 2.5.0, 2.1.4
Fix Version/s: 3.0 Alpha 1

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
Test case:

  SELECT LIST(F, '')
  FROM (
    SELECT CAST(ASCII_CHAR(0XFF) AS BLOB SUB_TYPE 0) AS F
    FROM RDB$DATABASE
    UNION ALL
    SELECT CAST(ASCII_CHAR(0XDE) AS BLOB SUB_TYPE 0) AS F
    FROM RDB$DATABASE
  )

returns 0x2E2E instead of the expected 0xFFDE. Internally the contents is treated as text and thus gets corrected by the blob filter (non-ASCII characters are replaced with dots).

The plain concatenation works correctly though:

  SELECT CAST(ASCII_CHAR(0XFF) AS BLOB SUB_TYPE 0) || CAST(ASCII_CHAR(0XDE) AS BLOB SUB_TYPE 0)
  FROM RDB$DATABASE

returns 0xFFDE.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 13/May/11 03:24 PM
This issue brings a question...

select cast(cast(x'FE' as blob sub_type binary) as varchar(10) character set octets) from rdb$database;

returns 2E (in octets), which is '.'

Is it correct or no?

Dmitry Yemanov added a comment - 19/May/11 06:50 AM
I'd say it's incorrect either. Binary data (regardless being blob or string) should not be treated as text data (and thus no transliteration must happen).

Pavel Cisar added a comment - 23/Sep/15 12:53 PM
Test created.