1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug #28272: crash that occurs when running an EXPLAIN command

for a query over an empty table right after its creation. 
The crash is the result of an attempt made by JOIN::optimize to evaluate
the WHERE condition when no records have been actually read.
The added test case can reproduce the crash only with InnoDB tables and
only with 5.0.x.
This commit is contained in:
igor@olga.mysql.com
2007-05-14 23:55:18 -07:00
parent d71043b889
commit 268be06874
3 changed files with 52 additions and 0 deletions

View File

@ -634,6 +634,12 @@ JOIN::optimize()
DBUG_PRINT("error",("Error: make_select() failed"));
DBUG_RETURN(1);
}
if (conds &&!outer_join && const_table_map != found_const_table_map &&
(select_options & SELECT_DESCRIBE) &&
select_lex->master_unit() == &thd->lex->unit) // upper level SELECT
{
conds=new Item_int((longlong) 0,1); // Always false
}
if (make_join_select(this, select, conds))
{
zero_result_cause=