[MDEV-31282] Second execution of prepare statement with ESCAPE clause fails with message "Incorrect arguments to ESCAPE" Created: 2023-05-16  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Prepared Statements
Affects Version/s: 10.4, 10.5, 10.6, 10.9, 10.10, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Dmitry Shulga
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-31003 Second execution for ps-protocol Stalled

 Description   

Testcase:

create table t1(f1 int);
insert into t1 values(1);
 
prepare stmt1 from "select * from (select 1 like 2 escape (1 in (select 1 from t1))) x";
 
execute stmt1;
execute stmt1;
 
deallocate prepare stmt1;
 
DROP TABLE t1;

Actual result:

execute stmt1;
1 like 2 escape (1 in (select 1 from t1))
0
execute stmt1;
 
mysqltest: At line 7: query 'execute stmt1' failed: 1210: Incorrect arguments to ESCAPE

Expected result:

execute stmt1;
1 like 2 escape (1 in (select 1 from t1))
0
execute stmt1;
1 like 2 escape (1 in (select 1 from t1))
0


Generated at Thu Feb 08 10:22:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.