From ff9c406c1d3ac007d0079a4ef16d86b7a8b823bb Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 13 Jul 2011 21:06:28 -0700 Subject: Fixed LP bug #809179. The attribute not_null_tables could be calculated incorrectly in the function SELECT_LEX::update_used_tables for queries over views with row items in the WHERE clause. It happened because no implementation of the virtual callback function eval_not_null_tables was provided for the class Item_row. Also slightly optimized the code calculating the value of the maybe_null flag for tables in the function SELECT_LEX::update_used_tables. --- sql/item_row.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sql/item_row.cc') diff --git a/sql/item_row.cc b/sql/item_row.cc index 99a1644cc48..09977d71bb7 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -93,6 +93,22 @@ bool Item_row::fix_fields(THD *thd, Item **ref) } +bool +Item_row::eval_not_null_tables(uchar *opt_arg) +{ + Item **arg,**arg_end; + not_null_tables_cache= 0; + if (arg_count) + { + for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) + { + not_null_tables_cache|= (*arg)->not_null_tables(); + } + } + return FALSE; +} + + void Item_row::cleanup() { DBUG_ENTER("Item_row::cleanup"); -- cgit v1.2.1