summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-07-10 17:19:45 -0700
committerIgor Babaev <igor@askmonty.org>2011-07-10 17:19:45 -0700
commitf8db35bd157f0e1c78cb86cb61200a9aaf7998c1 (patch)
tree635db0c8bf71399be55e5e07a519fee702e9a2be /sql/item_func.cc
parent7ff45c1379472953074318623017ccb7a66b8426 (diff)
downloadmariadb-git-f8db35bd157f0e1c78cb86cb61200a9aaf7998c1.tar.gz
Fixed LP bug #806504.
Missing initialization of the bitmap not_null_tables_cache to 0 in the function Item_func::eval_not_null_tables caused this bug. This function is called indirectly from the function SELECT_LEX::update_used_tables after merging mergeable views and derived tables into the main query. The leaf tables of resulting query may change their bitmap numbers after this merge. That's why the not_null_tables_cache bitmaps must be updated. Due to the bug mentioned above the result of the re-evaluation of the not_null_tables_cache turned out to be incorrect in some cases. This could trigger an invalid conversion of outer joins into inner joins leading to invalid query result sets. Also removed an implicit conversion from int to bool in the function SELECT_LEX::update_used_tables.
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 54c60ea03e1..033537092d8 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -234,6 +234,7 @@ bool
Item_func::eval_not_null_tables(uchar *opt_arg)
{
Item **arg,**arg_end;
+ not_null_tables_cache= 0;
if (arg_count)
{
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)