mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 15:15:34 +02:00
A fix and a test case for Bug#12736 "Server crash during a select".
The bug was in JOIN::join_free which was wrongly determining that
all joins have been already executed and therefore all used tables
can be closed.
mysql-test/r/subselect_innodb.result:
- test results fixed (Bug#12736 "Server crash during a select
mysql-test/t/subselect_innodb.test:
- a test case for Bug#12736 "Server crash during a select": test
that ha_index_or_rnd_end and mysql_unlock_tables are called
for all used tables in proper order.
sql/item_subselect.cc:
- implement subselect_union_engine::is_executed
sql/item_subselect.h:
- implement Item_subselect::is_evaluated. This function is used
to check whether we can clean up a non-correlated join of a subquery
when cleaning up the join of the outer query
sql/sql_lex.h:
- declare st_select_lex::cleanup_all_joins
sql/sql_select.cc:
- remove an argument from JOIN::join_free, it's now not used
- reimplement JOIN::join_free to not unlock tables if there
is a subquery that has not yet been evaluated. Make sure that the
new implementation calls ha_index_or_rnd_end for every table in
the join and inner joins, because all table cursors must be closed
before mysql_unlock_tables.
sql/sql_select.h:
- JOIN::join_free signature changed
sql/sql_union.cc:
- implement a helper method st_select_lex::cleanup_all_joins, which
recursively walks over a tree of joins and calls cleanup() for
each join.
This commit is contained in:
parent
20a6f1524a
commit
d31e997d57
8 changed files with 151 additions and 14 deletions
|
|
@ -1413,6 +1413,12 @@ void subselect_union_engine::cleanup()
|
|||
}
|
||||
|
||||
|
||||
bool subselect_union_engine::is_executed() const
|
||||
{
|
||||
return unit->executed;
|
||||
}
|
||||
|
||||
|
||||
void subselect_uniquesubquery_engine::cleanup()
|
||||
{
|
||||
DBUG_ENTER("subselect_uniquesubquery_engine::cleanup");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue