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:
@ -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=
|
||||
|
Reference in New Issue
Block a user