1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Igor Babaev
2011-07-13 21:06:28 -07:00
parent 7c46dc525e
commit ff9c406c1d
5 changed files with 118 additions and 5 deletions

View File

@ -3472,18 +3472,24 @@ void SELECT_LEX::update_used_tables()
List_iterator<TABLE_LIST> ti(leaf_tables);
while ((tl= ti++))
{
for (embedding= tl;
!tl->table->maybe_null && embedding;
embedding= embedding->embedding)
TABLE_LIST *embedding;
embedding= tl;
do
{
tl->table->maybe_null= test(embedding->outer_join);
bool maybe_null;
if ((maybe_null= test(embedding->outer_join)))
{
tl->table->maybe_null= maybe_null;
break;
}
}
while ((embedding= embedding->embedding));
if (tl->on_expr)
{
tl->on_expr->update_used_tables();
tl->on_expr->walk(&Item::eval_not_null_tables, 0, NULL);
}
TABLE_LIST *embedding= tl->embedding;
embedding= tl->embedding;
while (embedding)
{
if (embedding->on_expr &&