diff options
author | Igor Babaev <igor@askmonty.org> | 2021-06-07 15:08:18 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2021-06-07 15:08:18 -0700 |
commit | 8149e4d0a139b901c8902b5b9fae371cef47275f (patch) | |
tree | 60b22a76675c9670acdb4220a5f17d90d9fdfaf1 /sql/item_subselect.cc | |
parent | b1b4d67bcda32472f5b9c46465bff9db86904a00 (diff) | |
download | mariadb-git-8149e4d0a139b901c8902b5b9fae371cef47275f.tar.gz |
MDEV-25682 Explain shows an execution plan different from actually executed
If a select query contained an ORDER BY clause that followed a LIMIT clause
or an ORDER BY clause or ORDER BY with LIMIT the EXPLAIN output for the
query showed an execution plan different from that was actually executed.
Approved by Roman Nozdrin <roman.nozdrin@mariadb.com>
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 9f43561151d..352d80da92c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -274,6 +274,8 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) res= TRUE; goto end; } + if (sl == unit->first_select() && !sl->next_select()) + unit->fake_select_lex= 0; } } |