diff options
author | unknown <dlenev@brandersnatch.localdomain> | 2004-06-22 19:27:16 +0400 |
---|---|---|
committer | unknown <dlenev@brandersnatch.localdomain> | 2004-06-22 19:27:16 +0400 |
commit | b62ab1abdaf885f08044f50cf13afb30d75cbb66 (patch) | |
tree | d0e1e3af3a439cdd96e7e95fea25e1dc8d02a760 /sql/sql_yacc.yy | |
parent | c493075036bdf2620b93bf3a9893150bd5cc4af2 (diff) | |
download | mariadb-git-b62ab1abdaf885f08044f50cf13afb30d75cbb66.tar.gz |
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).
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 89915852b9b..f4c249c2676 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -606,7 +606,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %type <simple_string> remember_name remember_end opt_ident opt_db text_or_password - opt_escape opt_constraint constraint + opt_constraint constraint %type <string> text_string opt_gconcat_separator @@ -634,7 +634,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); using_list expr_or_default set_expr_or_default interval_expr param_marker singlerow_subselect singlerow_subselect_init exists_subselect exists_subselect_init geometry_function - signed_literal now_or_signed_literal + signed_literal now_or_signed_literal opt_escape %type <item_num> NUM_literal @@ -3570,8 +3570,12 @@ having_clause: ; opt_escape: - ESCAPE_SYM TEXT_STRING_literal { $$= $2.str; } - | /* empty */ { $$= (char*) "\\"; }; + ESCAPE_SYM simple_expr { $$= $2; } + | /* empty */ + { + $$= new Item_string("\\", 1, &my_charset_latin1); + } + ; /* |