1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for Bug# 4200 "Parse error on LIKE ESCAPE with parameter binding"

Now ESCAPE in LIKE will accept not only string literal but constant 
delimited expression.
This commit is contained in:
dlenev@brandersnatch.localdomain
2004-06-22 19:27:16 +04:00
parent 6b45c24d39
commit eea19e5235
6 changed files with 80 additions and 46 deletions

View File

@ -45,6 +45,12 @@ a\b
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
a
a\b
prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?';
set @esc='#';
execute stmt1 using @esc;
a
a\b
deallocate prepare stmt1;
drop table t1;
create table t1 (a datetime);
insert into t1 values ('2004-03-11 12:00:21');

View File

@ -25,14 +25,23 @@ select * from t1 where a like "%abc\d%";
drop table t1;
create table t1 (a varchar(10), key(a));
#
# Bug #2231
#
create table t1 (a varchar(10), key(a));
insert into t1 values ('a'), ('a\\b');
select * from t1 where a like 'a\\%' escape '#';
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
#
# Bug #4200: Prepared statement parameter as argument to ESCAPE
#
prepare stmt1 from 'select * from t1 where a like \'a\\%\' escape ?';
set @esc='#';
execute stmt1 using @esc;
deallocate prepare stmt1;
drop table t1;
#