diff options
author | unknown <igor@rurik.mysql.com> | 2004-11-10 11:22:39 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2004-11-10 11:22:39 -0800 |
commit | 2ef4c97e9daed004ae4d60ea6e71b31b1f230ad1 (patch) | |
tree | 29cd072a8be4c60dac69816bd35128b7be4dda14 /sql/sql_select.cc | |
parent | 96bd70c7750aa2a9e39eaeb1da917f89f04173b9 (diff) | |
download | mariadb-git-2ef4c97e9daed004ae4d60ea6e71b31b1f230ad1.tar.gz |
select.result, select.test:
Added test cases for bug #6474.
sql_select.cc:
Fixed bug #6474. A wrong result was returned when a query
contained the same equality of the form field=const on
different AND levels.
sql/sql_select.cc:
Fixed bug #6474. A wrong result was returned when a query
contained the same equality of the form field=const on
different AND levels.
mysql-test/t/select.test:
Added test cases for bug #6474.
mysql-test/r/select.result:
Added test cases for bug #6474.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 85feea3d51a..686316d80a6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6639,10 +6639,7 @@ static Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels, List<Item> eq_list; Item_func_eq *eq_item= 0; if (((Item *) item_equal)->const_item() && !item_equal->val_int()) - { - cond= new Item_int((char*) "FALSE",0,1); - return cond; - } + return new Item_int((longlong) 0,1); Item *item_const= item_equal->get_const(); Item_equal_iterator it(*item_equal); Item *head; @@ -6685,9 +6682,14 @@ static Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels, } if (!cond && !eq_list.head()) + { + if (!eq_item) + return new Item_int((longlong) 1,1); return eq_item; + } - eq_list.push_back(eq_item); + if (eq_item) + eq_list.push_back(eq_item); if (!cond) cond= new Item_cond_and(eq_list); else |