summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2012-06-19 15:06:45 +0300
committerunknown <timour@askmonty.org>2012-06-19 15:06:45 +0300
commit0b93b444b6c4de6b219fd3a4b3d5fa2e388dc211 (patch)
tree14476572c91530f3b354041e1683e2b042b9a9cd /sql/item_cmpfunc.cc
parent37f8094652c438360b66aa04a46acb96d3eea6b7 (diff)
parentcf3a499f541e66e1b8aa96fe16e36a48ed1c0a0e (diff)
downloadmariadb-git-0b93b444b6c4de6b219fd3a4b3d5fa2e388dc211.tar.gz
Merged the fix for bug lp:944706, mdev-193
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index e38fe057356..f0caa0d9b25 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -5541,7 +5541,15 @@ void Item_equal::add_const(Item *c, Item *f)
else
{
Item_func_eq *func= new Item_func_eq(c, const_item);
- func->set_cmp_func();
+ if (func->set_cmp_func())
+ {
+ /*
+ Setting a comparison function fails when trying to compare
+ incompatible charsets. Charset compatibility is checked earlier,
+ except for constant subqueries where we may do it here.
+ */
+ return;
+ }
func->quick_fix_field();
cond_false= !func->val_int();
}