You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: