Skip to content

Results of concatenation with blob has no info about collation of source columns (which are declared with such info) [CORE6532] #6759

@firebird-automations

Description

@firebird-automations

Submitted by: @pavel-zotov

set bail on;
set list on;

shell del c:\temp\tmp.fdb 2>nul;
create database 'localhost:c:\temp\tmp.fdb';

create collation name_coll for utf8 from unicode case insensitive;
commit;

--create domain dm_name_ci as varchar(10) character set utf8 collate name_coll;
create domain dm_name_ci as blob sub_type text character set utf8 collate name_coll;
commit;

recreate table test(
id int
,c1 varchar(10) character set utf8 collate name_coll
,b1 dm_name_ci
--,b1 blob sub_type text character set utf8 collate name_coll -- same result
);

insert into test(id, c1, b1) values(1,'qWE','qWE');
insert into test(id, c1, b1) values(2,'QWe','QWe');
insert into test(id, c1, b1) values(3,'qwE','qwE');
commit;

set count on;
set echo on;

---------------------------------------------

select id from test
where
b1 starting with 'qwe' -- Records affected: 3 // OK
;

---------------------------------------------

select id from test
where
b1 || b1 starting with 'qwe' -- Records affected: 0
;

--------------------------------------------

select id from test
where
c1 || cast(c1 as blob sub_type text character set utf8) collate name_coll starting with 'qwe' -- Records affected: 0
;
---------------------------------------------

set sqlda_display on;

select
b1
,b1 || b1 as "b1 || b1"
,c1 || cast(c1 as blob sub_type text character set utf8) collate name_coll as "c1 || cast(c1 as blob)"
from test t rows 0;

set sqlda_display off;

Commits: 4ab8bc0 9370c98

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions