summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-03-24 12:44:54 -0800
committerunknown <igor@rurik.mysql.com>2006-03-24 12:44:54 -0800
commitc0579144d5a9a9c64aa4a928aaefed45152185f1 (patch)
tree63bb58642c32bd38668b94b907e3c3f8d1519531 /sql/item_cmpfunc.cc
parent16c47ef42d93f173f9aa2117c0805082b2811533 (diff)
downloadmariadb-git-c0579144d5a9a9c64aa4a928aaefed45152185f1.tar.gz
Fixed bug #17164.
If the WHERE condition of a query contained an ORed FALSE term then the set of tables whose rows cannot serve for null complements in outer joins was determined incorrectly. It resulted in blocking possible conversions of outer joins into joins for such queries. mysql-test/r/join_outer.result: Added a test case for bug #17164. mysql-test/t/join_outer.test: Added a test case for bug #17164.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index b31853ccf02..2d74ea9c518 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2563,10 +2563,13 @@ Item_cond::fix_fields(THD *thd, Item **ref)
(item= *li.ref())->check_cols(1))
return TRUE; /* purecov: inspected */
used_tables_cache|= item->used_tables();
- tmp_table_map= item->not_null_tables();
- not_null_tables_cache|= tmp_table_map;
- and_tables_cache&= tmp_table_map;
- const_item_cache&= item->const_item();
+ if (!item->const_item())
+ {
+ tmp_table_map= item->not_null_tables();
+ not_null_tables_cache|= tmp_table_map;
+ and_tables_cache&= tmp_table_map;
+ const_item_cache= FALSE;
+ }
with_sum_func= with_sum_func || item->with_sum_func;
if (item->maybe_null)
maybe_null=1;