mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +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. mysql-test/r/func_like.result: Added test for bug# 4200 "Parse error on LIKE ESCAPE with parameter binding" mysql-test/t/func_like.test: Added test for bug# 4200 "Parse error on LIKE ESCAPE with parameter binding" sql/item_cmpfunc.cc: Added support for accepting of constant delimited expression as ESCAPE argument to Item_func_like. sql/item_cmpfunc.h: Now ESCAPE clause in LIKE will accept not only string literal but constant delimited expression. Thus added member to Item_func_like for storing Item corresponding to this expression and changed third argument of cons to be Item* instead of char*. sql/sql_help.cc: Item_func_like now accepts Item* as third argument. sql/sql_yacc.yy: Now ESCAPE clause of LIKE accepts not only string literal but constant delimited expression (the most important case is prepared statement parameter of course).
This commit is contained in:
@ -626,7 +626,7 @@ SQL_SELECT *prepare_select_for_name(THD *thd, const char *mask, uint mlen,
|
||||
{
|
||||
Item *cond= new Item_func_like(new Item_field(pfname),
|
||||
new Item_string(mask,mlen,pfname->charset()),
|
||||
(char*) "\\");
|
||||
new Item_string("\\",1,&my_charset_latin1));
|
||||
if (thd->is_fatal_error)
|
||||
return 0; // OOM
|
||||
return prepare_simple_select(thd,cond,tables,table,error);
|
||||
|
Reference in New Issue
Block a user