summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2004-06-22 19:27:16 +0400
committerunknown <dlenev@brandersnatch.localdomain>2004-06-22 19:27:16 +0400
commit4c670550d266d66a7ab0f0883b6e3994346872dc (patch)
treed0e1e3af3a439cdd96e7e95fea25e1dc8d02a760 /sql/item_cmpfunc.h
parent227f223d6bbcab16c29b020315b79cf7143e669b (diff)
downloadmariadb-git-4c670550d266d66a7ab0f0883b6e3994346872dc.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/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index ef80c060c03..4a7e7e06f10 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -841,12 +841,14 @@ class Item_func_like :public Item_bool_func2
bool turboBM_matches(const char* text, int text_len) const;
enum { alphabet_size = 256 };
+ Item *escape_item;
+
public:
char escape;
- Item_func_like(Item *a,Item *b, char* escape_arg)
+ Item_func_like(Item *a,Item *b, Item *escape_arg)
:Item_bool_func2(a,b), canDoTurboBM(false), pattern(0), pattern_len(0),
- bmGs(0), bmBc(0), escape(*escape_arg) {}
+ bmGs(0), bmBc(0), escape_item(escape_arg) {}
longlong val_int();
enum Functype functype() const { return LIKE_FUNC; }
optimize_type select_optimize() const;