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
set bail on;
set list on;
set names utf8;
shell del c:\temp\tmp4test.fdb 2>nul;
create database 'localhost:c:\temp\tmp4test.fdb' default character set utf8;
show version;
recreate table test(
id int generated by default as identity constraint pk_txt primary key
,txt varchar(1) character set utf8
);
insert into test(txt) values('A');
insert into test(txt) values('B'); ---------------------------------- [ 0 ]
set term ^;
execute block returns(
o_id type of column test.id
,o_txt type of column test.txt
) as
declare b boolean;
begin
for select id, txt from test as cursor c
do begin
o_id = c.id;
o_txt = c.txt;
suspend;
begin
b = c.txt similar to 'Ⱥ{0,1}'; ------------ [ 1 ]
--b = c.txt similar to 'A{0,1}'; ---------------- [ 2 ]
when any do
begin
--exception; -------------------------------- [ 3 ]
end
end
end
end
^
set term ;^
quit;
If we run it on WI-V3.0.8.33473 then FB will crash (stack-trace was created and sent to Adriano et al.)
If we comment out line marked as [ 1 ] and uncomment line [ 2 ], then script finished OK.
If we revert previous state ( make [1] uncommented and [2] commented out) but do uncomment line marked as [ 3 ] then output will be:
O_ID 1
O_TXT A
Statement failed, SQLSTATE = 42000
Invalid SIMILAR TO pattern
-At block line: 13, col: 4
-At block line: 17, col: 5
Finally, if we add to the table only ONE row (i.e. comment out, for example, line marked as [ 0 ] ) then test finished OK (no crash).
PS
Problem was found during implementing test for GH-5534. Ticket was created after Adriano request.
The text was updated successfully, but these errors were encountered:
execute block returns(
o_id type of column test.id,
o_txt type of column test.txt
) as
declare b boolean;
begin
for select id, txt from test as cursor c
do
begin
o_id = c.id;
o_txt = c.txt;
suspend;
begin
b = c.txt like '\' escape '\';
when any do
begin
end
end
end
end!
pavel-zotov
changed the title
Crash occurs when use SIMILAR TO and compare string with pattern that contains non-ascii character with suppressed exception handling (or "Invalid SIMILAR TO pattern" raises otherwise)
Crash occurs when use SIMILAR TO
Jun 15, 2021
Consider following script:
If we run it on WI-V3.0.8.33473 then FB will crash (stack-trace was created and sent to Adriano et al.)
If we comment out line marked as [ 1 ] and uncomment line [ 2 ], then script finished OK.
If we revert previous state ( make [1] uncommented and [2] commented out) but do uncomment line marked as [ 3 ] then output will be:
Finally, if we add to the table only ONE row (i.e. comment out, for example, line marked as [ 0 ] ) then test finished OK (no crash).
PS
Problem was found during implementing test for GH-5534. Ticket was created after Adriano request.
The text was updated successfully, but these errors were encountered: