mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-25679 Wrong result selecting from simple view with LIMIT and ORDER BY
This bug affected queries with views / derived_tables / CTEs whose specifications were of the form (SELECT ... LIMIT <n>) ORDER BY ... Units representing such specifications contains one SELECT_LEX structure for (SELECT ... LIMIT <n>) and additionally SELECT_LEX structure for fake_select_lex. This fact should have been taken into account in the function mysql_derived_fill(). This patch has to be applied to 10.2 and 10.3 only.
This commit is contained in:
@ -1163,7 +1163,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
|
||||
res= derived->fill_recursive(thd);
|
||||
}
|
||||
}
|
||||
else if (unit->is_unit_op())
|
||||
else if (unit->is_unit_op() || unit->fake_select_lex)
|
||||
{
|
||||
// execute union without clean up
|
||||
res= unit->exec();
|
||||
|
Reference in New Issue
Block a user