diff options
author | unknown <knielsen@knielsen-hq.org> | 2012-08-24 13:51:16 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2012-08-24 13:51:16 +0200 |
commit | e44a800d91a887119d3b612276b37f09b076fee1 (patch) | |
tree | e6e716d515167a5b9390f8cc1af559981eceb072 /sql/item_cmpfunc.cc | |
parent | ed06ba3492d55c9e9dde231b55352f854e5e4b50 (diff) | |
parent | 60561ae6133cf40f4fc445e1d6e8f395a20b2573 (diff) | |
download | mariadb-git-e44a800d91a887119d3b612276b37f09b076fee1.tar.gz |
Merge from 5.2
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index f5960bb6c15..fed246ef812 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -3007,6 +3007,15 @@ void Item_func_case::fix_length_and_dec() return; } } + /* + Set cmp_context of all WHEN arguments. This prevents + Item_field::equal_fields_propagator() from transforming a + zerofill argument into a string constant. Such a change would + require rebuilding cmp_items. + */ + for (i= 0; i < ncases; i+= 2) + args[i]->cmp_context= item_cmp_type(left_result_type, + args[i]->result_type()); } if (else_expr_num == -1 || args[else_expr_num]->maybe_null) @@ -3986,6 +3995,16 @@ void Item_func_in::fix_length_and_dec() } } } + /* + Set cmp_context of all arguments. This prevents + Item_field::equal_fields_propagator() from transforming a zerofill integer + argument into a string constant. Such a change would require rebuilding + cmp_itmes. + */ + for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++) + { + arg[0]->cmp_context= item_cmp_type(left_result_type, arg[0]->result_type()); + } max_length= 1; } |