diff options
Diffstat (limited to 'mysql-test/t/func_like.test')
-rw-r--r-- | mysql-test/t/func_like.test | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 5026bb76aa3..c7a59a6fcbd 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -187,7 +187,7 @@ DROP TABLE t1; --echo # # -# Item_func_line::print() +# Item_func_like::print() # create view v1 as select 'foo!' like 'foo!!', 'foo!' like 'foo!!' escape '!'; show create view v1; @@ -207,3 +207,30 @@ insert t1 (a) values ('3 f_'), ('3 f\_'); set sql_mode=default; select * from t1; drop table t1; + +# +# Item_func_like::fix_fields() +# +create table t1 (f int); +insert t1 values (1),(2); +select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1)); +drop table t1; + +# +# Item_func_like::fix_fields, ESCAPE, const_item() +# +create table t1(f1 int); +insert into t1 values(1); +--error ER_WRONG_ARGUMENTS +update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1; +select * from (select 1 like 2 escape (1 in (select 1 from t1))) x; +drop table t1; + +# +# Item_func_like::walk +# +create table t1 (f int); +insert t1 values (1),(2); +create view v1 as select * from t1 where (1 like 2 escape (3 in (('h', 'b') in (select 'k', 'k' union select 'g', 'j'))) and f >= 0); +drop view v1; +drop table t1; |