mirror of
https://github.com/MariaDB/server.git
synced 2026-04-26 10:15:29 +02:00
fix for bug #12595 (Escape character has to be exactly one)
mysql-test/r/select.result: results for test of bug 12595 mysql-test/t/select.test: test for bug #12595 sql/item_cmpfunc.cc: check whether the size of the escape string is exactly 1 (bug #12595)
This commit is contained in:
parent
ef5cafdf6d
commit
8056a7df59
3 changed files with 29 additions and 1 deletions
|
|
@ -2792,8 +2792,14 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
|
|||
{
|
||||
/* If we are on execution stage */
|
||||
String *escape_str= escape_item->val_str(&tmp_value1);
|
||||
/* ESCAPE must be 1 char in length.*/
|
||||
if (escape_str && escape_str->numchars() != 1)
|
||||
{
|
||||
my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE");
|
||||
return TRUE;
|
||||
}
|
||||
escape= escape_str ? *(escape_str->ptr()) : '\\';
|
||||
|
||||
|
||||
/*
|
||||
We could also do boyer-more for non-const items, but as we would have to
|
||||
recompute the tables for each row it's not worth it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue