diff options
author | unknown <timour@askmonty.org> | 2011-07-14 12:53:00 +0300 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2011-07-14 12:53:00 +0300 |
commit | 53681ee5db74e0495efb527e11fc556744967f5a (patch) | |
tree | ea592be46a85ac8d6d282d06c7dd18a3435f1a64 /mysql-test/r/explain.result | |
parent | c4097382efab39baaa142b6c475c9f9afc24d787 (diff) | |
download | mariadb-git-53681ee5db74e0495efb527e11fc556744967f5a.tar.gz |
Fix bug lp:777691
Analysis:
For some of the re-executions of the correlated subquery the
where clause is false. In these cases the execution of the
subquery detects that it must generate a NULL row because of
implicit grouping. In this case the subquery execution reaches
the following code in do_select():
while ((table= li++))
mark_as_null_row(table->table);
This code marks all rows in the table as complete NULL rows.
In the example, when evaluating the field t2.f10 for the second
row, all bits of Field::null_ptr[0] are set by the previous call
to mark_as_null_row(). Then the call to Field::is_null()
returns true, resulting in a NULL for the MAX function.
Thus the lines above are not suitable for subquery re-execution
because mark_as_null_row() changes the NULL bits of each table
field, and there is no logic to restore these fields.
Solution:
The call to mark_as_null_row() was added by the fix for bug
lp:613029. Therefore removing the fix for lp:613029 corrects
this wrong result. At the same time the test for lp:613029
behaves correctly because the changes of MWL#89 result in a
different execution path where:
- the constant subquery is evaluated via JOIN::exec_const_cond
- detecting that it has an empty result triggers the branch
if (zero_result_cause)
return_zero_rows()
- return_zero_rows() calls mark_as_null_row().
Diffstat (limited to 'mysql-test/r/explain.result')
0 files changed, 0 insertions, 0 deletions