summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index ee0bf605d69..35fc14a0744 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2990,14 +2990,13 @@ void st_select_lex::print_limit(THD *thd,
if (item && unit->global_parameters() == this)
{
Item_subselect::subs_type subs_type= item->substype();
- if (subs_type == Item_subselect::EXISTS_SUBS ||
- subs_type == Item_subselect::IN_SUBS ||
+ if (subs_type == Item_subselect::IN_SUBS ||
subs_type == Item_subselect::ALL_SUBS)
{
return;
}
}
- if (explicit_limit)
+ if (explicit_limit && select_limit)
{
str->append(STRING_WITH_LEN(" limit "));
if (offset_limit)