Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIST function wrongly concatenates binary blobs [CORE3476] #3837

Closed
firebird-issue-importer opened this issue May 12, 2011 · 8 comments
Closed

Comments

@firebird-issue-importer

Submitted by: @dyemanov

Is related to QA566

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.

Commits: 6987232

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 12, 2011

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 13, 2011

Commented by: @asfernandes

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?

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 19, 2011

Commented by: @dyemanov

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).

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 21, 2011

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 29, 2014

Modified by: @pcisar

Link: This issue is related to QA566 [ QA566 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment