1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed bug #15347: Wrong result of subselect when records cache and set

functions are involved.

When subselect is a join with set functions and no record have been found in
it, end_send_group() sets null_row for all tables in order aggregate functions 
to calculate their values correctly. Normally this null_row flag is cleared for 
each table in sub_select(), but flush_cached_records() doesn't do so.
Due to this all fields from the table processed by flush_cached_records() are 
always evaluated as nulls and whole select produces wrong result.

flush_cached_records() now clears null_row flag at the very beginning.
This commit is contained in:
evgen@moonbone.local
2006-01-11 23:16:21 +03:00
parent c8000f437d
commit 3e23d458f9
3 changed files with 25 additions and 0 deletions

View File

@@ -9853,6 +9853,7 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last)
int error;
READ_RECORD *info;
join_tab->table->null_row= 0;
if (!join_tab->cache.records)
return NESTED_LOOP_OK; /* Nothing to do */
if (skip_last)