mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixes for OPTION_FOUND_ROWS in UNION's
mysql-test/r/subselect.result: A warning added to subselect test due to the recent changes. UNION in sub-select returns the empty set, which is why this warning is a mistery to me. mysql-test/r/union.result: two changes. First one is due to the proper handling of LIMIT offset, limit in UNION without all. Second is a change in behaviour due to the fact that ORDER by in a UNION without braces is not now applicable to the last SELECT node. It can not be applied until one bug is fixed (after my vacation). Should be documented.
This commit is contained in:
@@ -281,7 +281,7 @@ int st_select_lex_unit::exec()
|
||||
*/
|
||||
sl->options|= found_rows_for_union;
|
||||
}
|
||||
|
||||
sl->join->select_options=sl->options;
|
||||
/*
|
||||
As far as union share table space we should reassign table map,
|
||||
which can be spoiled by 'prepare' of JOIN of other UNION parts
|
||||
@@ -311,6 +311,7 @@ int st_select_lex_unit::exec()
|
||||
records_at_start= table->file->records;
|
||||
sl->join->exec();
|
||||
res= sl->join->error;
|
||||
offset_limit_cnt= sl->offset_limit;
|
||||
if (!res && union_result->flush())
|
||||
{
|
||||
thd->lex.current_select= lex_select_save;
|
||||
@@ -332,7 +333,7 @@ int st_select_lex_unit::exec()
|
||||
We get this from the difference of between total number of possible
|
||||
rows and actual rows added to the temporary table.
|
||||
*/
|
||||
add_rows+= (ha_rows) (thd->limit_found_rows - (ulonglong)
|
||||
add_rows+= (ulonglong) (thd->limit_found_rows - (ulonglong)
|
||||
((table->file->records - records_at_start)));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user