summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 74eed7fa41a..c4d3d6f7ab4 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2443,9 +2443,9 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
String *escape_str= escape_item->val_str(&tmp_value1);
if (escape_str)
{
- CHARSET_INFO *cs= cmp.cmp_collation.collation;
- if (use_mb(cs))
+ if (use_mb(cmp_collation.collation))
{
+ CHARSET_INFO *cs= escape_str->charset();
my_wc_t wc;
int rc= cs->cset->mb_wc(cs, &wc,
(const uchar*) escape_str->ptr(),
@@ -2460,6 +2460,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
code instead of Unicode code as "escape" argument.
Convert to "cs" if charset of escape differs.
*/
+ CHARSET_INFO *cs= cmp_collation.collation;
uint32 unused;
if (escape_str->needs_conversion(escape_str->length(),
escape_str->charset(), cs, &unused))