diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-16 18:44:17 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-12-16 18:44:17 +0200 |
commit | c6b904abf8a139a3b95c9825cc7c53fd8f1a6fd0 (patch) | |
tree | a0d8f4957cf9d256a3cc3445c7db25384f97e249 /sql/item_cmpfunc.cc | |
parent | 28a5059a92707e009aada358bf103fa386ea7c2c (diff) | |
parent | 3d799bdffd04beba3dad4f1ece915104b0284157 (diff) | |
download | mariadb-git-c6b904abf8a139a3b95c9825cc7c53fd8f1a6fd0.tar.gz |
merge mysql-5.5->mysql-5.5-bugteam
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 18a92c6b8c2..737fa02bcd2 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -4720,6 +4720,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) String *escape_str= escape_item->val_str(&cmp.value1); if (escape_str) { + const char *escape_str_ptr= escape_str->ptr(); if (escape_used_in_parsing && ( (((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) && escape_str->numchars() != 1) || @@ -4734,9 +4735,9 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) CHARSET_INFO *cs= escape_str->charset(); my_wc_t wc; int rc= cs->cset->mb_wc(cs, &wc, - (const uchar*) escape_str->ptr(), - (const uchar*) escape_str->ptr() + - escape_str->length()); + (const uchar*) escape_str_ptr, + (const uchar*) escape_str_ptr + + escape_str->length()); escape= (int) (rc > 0 ? wc : '\\'); } else @@ -4753,13 +4754,13 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) { char ch; uint errors; - uint32 cnvlen= copy_and_convert(&ch, 1, cs, escape_str->ptr(), + uint32 cnvlen= copy_and_convert(&ch, 1, cs, escape_str_ptr, escape_str->length(), escape_str->charset(), &errors); escape= cnvlen ? ch : '\\'; } else - escape= *(escape_str->ptr()); + escape= escape_str_ptr ? *escape_str_ptr : '\\'; } } else |