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

MDEV-19363 Assertion `select_lex' failed in LEX::pop_select

This patch corrects the patch for MDEV-19324. The latter did not
work properly in the cases when the transformation
  (SELECT ... ORDER BY ...) LIMIT ... =>
   SELECT ... ORDER BY ... LIMIT ...
was applied to the operands of a set operation.
This commit is contained in:
Igor Babaev
2019-05-01 18:20:06 -07:00
parent ea679c88c3
commit 2b7e080fae
3 changed files with 79 additions and 3 deletions

View File

@ -9147,13 +9147,15 @@ SELECT_LEX *LEX::parsed_select(SELECT_LEX *sel, Lex_order_limit_lock * l)
}
else
{
SELECT_LEX_UNIT *unit= create_unit(sel);
if (!unit)
return NULL;
if (!l->order_list && !sel->explicit_limit)
l->order_list= &sel->order_list;
else
{
SELECT_LEX_UNIT *unit= create_unit(sel);
if (!unit)
return NULL;
sel= wrap_unit_into_derived(unit);
}
if (!sel)
return NULL;
l->set_to(sel);