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-automations opened this issue May 12, 2011 · 8 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

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-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA566 [ QA566 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Test created.

@firebird-automations
Copy link
Collaborator Author

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