1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

BUG#724228: Wrong result with materialization=on and three aggregates in maria-5.3-mwl90

- In join buffering code, call join_tab_execution_startup() (#1) before we call join_tab_scan->open() (#2).
  This is important with SJ-Materialization because #1 fills the materialized table, while
  #2 will actually try to read the first row. Attempt to read the first row before we have
  populated the materialized table would cause zero rows to be returned when actually there were matches.
This commit is contained in:
Sergey Petrunya
2011-03-01 12:01:10 +03:00
parent 862135a18a
commit b8f00542e2
3 changed files with 56 additions and 4 deletions

View File

@ -2139,14 +2139,13 @@ enum_nested_loop_state JOIN_CACHE::join_matching_records(bool skip_last)
join_tab->select->quick= 0;
}
if ((rc= join_tab_execution_startup(join_tab)) < 0)
goto finish;
/* Prepare to retrieve all records of the joined table */
if ((error= join_tab_scan->open()))
goto finish; /* psergey-note: if this returns error, we will assert in net_send_statement() */
if ((rc= join_tab_execution_startup(join_tab)) < 0)
goto finish;
while (!(error= join_tab_scan->next()))
{
if (join->thd->killed)