summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-24 14:47:48 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-06-24 14:47:48 +0400
commitc34caf25e390a5711acf8bbcf59089e0447d67af (patch)
tree447c1e068f5894f0db83f7cb3946d3e1c588d4eb /sql
parent389c68a8d46f77c68843019408f0ac7725fdb3db (diff)
parent1f74e5f3a8bf5c09fdfc27e3d8da2a5943ad1979 (diff)
downloadmariadb-git-c34caf25e390a5711acf8bbcf59089e0447d67af.tar.gz
Automerge.
Diffstat (limited to 'sql')
-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 3c871bc0663..cea5b3c90fd 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2777,6 +2777,8 @@ Item *Item_func_case::find_item(String *str)
/* Compare every WHEN argument with it and return the first match */
for (uint i=0 ; i < ncases ; i+=2)
{
+ if (args[i]->real_item()->type() == NULL_ITEM)
+ continue;
cmp_type= item_cmp_type(left_result_type, args[i]->result_type());
DBUG_ASSERT(cmp_type != ROW_RESULT);
DBUG_ASSERT(cmp_items[(uint)cmp_type]);
@@ -4007,9 +4009,17 @@ longlong Item_func_in::val_int()
return (longlong) (!null_value && tmp != negated);
}
+ if ((null_value= args[0]->real_item()->type() == NULL_ITEM))
+ return 0;
+
have_null= 0;
for (uint i= 1 ; i < arg_count ; i++)
{
+ if (args[i]->real_item()->type() == NULL_ITEM)
+ {
+ have_null= TRUE;
+ continue;
+ }
Item_result cmp_type= item_cmp_type(left_result_type, args[i]->result_type());
in_item= cmp_items[(uint)cmp_type];
DBUG_ASSERT(in_item);