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

Heterogenous blob vs non-blob comparisons do not work correctly [CORE3278] #3646

Open
firebird-automations opened this issue Dec 15, 2010 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dyemanov

When a blob is compared to a non-blob, the latter one gets implicitly converted to a string and then compared. This is contrary to the way strings are compared to non-strings, where data type priority rules are applied.

Test cases:

select 1 from rdb$database
where cast('01' as varchar(3)) = 1
-- vs
select 1 from rdb$database
where cast('01' as blob sub_type text) = 1

select 1 from rdb$database
where cast('01.01.0001' as varchar(10)) = date '01-JAN-0001'
-- vs
select 1 from rdb$database
where cast('01.01.0001' as blob sub_type text) = date '01-JAN-0001'

IMO, we should either compare them properly or throw an error.

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

No branches or pull requests

1 participant