1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed the bug mdev-12855.

This is actually a legacy bug:
SQL_SELECT::test_quick_select() was called
with SQL_SELECT::head not set.
It looks like that this problem can be
reproduced only on queries with ORDER BY
that use IN predicates converted to semi-joins.
This commit is contained in:
Igor Babaev
2017-06-07 22:54:57 -07:00
parent 151f4e9b4a
commit b850fc66ca
3 changed files with 46 additions and 1 deletions

View File

@ -2759,8 +2759,11 @@ JOIN::exec()
if (sort_table_cond)
{
if (!curr_table->select)
{
if (!(curr_table->select= new SQL_SELECT))
DBUG_VOID_RETURN;
curr_table->select->head= curr_table->table;
}
if (!curr_table->select->cond)
curr_table->select->cond= sort_table_cond;
else
@ -2846,7 +2849,7 @@ JOIN::exec()
curr_join->select_limit,
(select_options & OPTION_FOUND_ROWS ?
HA_POS_ERROR : unit->select_limit_cnt),
curr_join->group_list ? TRUE : FALSE))
curr_join->group_list ? FALSE : TRUE))
DBUG_VOID_RETURN;
sortorder= curr_join->sortorder;
if (curr_join->const_tables != curr_join->table_count &&