1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00
Non-correlated scalar subqueries may get executed
in EXPLAIN at the optimization phase if they are
part of a right hand sargable expression.
If the scalar subquery uses a temp table to 
materialize its results it will replace the 
subquery structure from the parser with a simple
select from the materialization table.
As a result the EXPLAIN will crash as the 
temporary materialization table is not to be shown
in EXPLAIN at all.
Fixed by preserving the original query structure
right after calling optimize() for scalar subqueries
with temp tables executed during EXPLAIN.


mysql-test/r/subselect.result:
  Bug #27807: test case
mysql-test/t/subselect.test:
  Bug #27807: test case
sql/item_subselect.cc:
  Bug #27807: preserve the join structure
sql/sql_select.cc:
  Bug #27807: introduce initialization function for tmp_join
sql/sql_select.h:
  Bug #27807: introduce initialization function for tmp_join
This commit is contained in:
unknown
2007-05-04 10:48:51 +03:00
parent 5a35befff5
commit 0ad4e1b2a6
5 changed files with 62 additions and 8 deletions

View File

@@ -434,6 +434,7 @@ public:
void cleanup(bool full);
void clear();
bool save_join_tab();
bool init_save_join_tab();
bool send_row_on_empty_set()
{
return (do_send_rows && tmp_table_param.sum_func_count != 0 &&