diff options
author | unknown <bell@sanja.is.com.ua> | 2004-02-04 15:26:41 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-02-04 15:26:41 +0200 |
commit | fc248069e95958de6a8e3e2e3ebd31d523ec945e (patch) | |
tree | b2aabd3ef50274e4b7d230f304fbd12c7c3130e5 /sql/sql_lex.cc | |
parent | 7f6f30284e8834985884578dc723582e1e266aea (diff) | |
download | mariadb-git-fc248069e95958de6a8e3e2e3ebd31d523ec945e.tar.gz |
correct assignment of default limit (BUG#2600)
mysql-test/r/subselect.result:
test of global limit and subqueries
mysql-test/t/subselect.test:
test of global limit and subqueries
sql/sql_lex.cc:
correct detection of non-default limits
sql/sql_parse.cc:
correct assignment of default limit
sql/sql_yacc.yy:
correct assignment of default limit
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 65c958093bd..c6322b116ec 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1540,8 +1540,9 @@ void st_select_lex::print_limit(THD *thd, String *str) if (!thd) thd= current_thd; - if (select_limit != thd->variables.select_limit || - select_limit != HA_POS_ERROR || + if ((select_limit != thd->variables.select_limit && + this == &thd->lex->select_lex) || + (select_limit != HA_POS_ERROR && this != &thd->lex->select_lex) || offset_limit != 0L) { str->append(" limit ", 7); |