summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index f4f68e007a0..64f2a447bad 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -545,6 +545,16 @@ bool Arg_comparator::set_cmp_func_string()
if (owner->agg_arg_charsets_for_comparison(&m_compare_collation, a, b))
return true;
}
+
+ if ((*a)->is_json_type() ^ (*b)->is_json_type())
+ {
+ Item **j_item= (*a)->is_json_type() ? a : b;
+ Item *uf= new(thd->mem_root) Item_func_json_unquote(thd, *j_item);
+ if (!uf || uf->fix_fields(thd, &uf))
+ return 1;
+ *j_item= uf;
+ }
+
a= cache_converted_constant(thd, a, &a_cache, compare_type_handler());
b= cache_converted_constant(thd, b, &b_cache, compare_type_handler());
return false;