1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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
This commit is contained in:
unknown
2004-02-04 15:26:41 +02:00
parent 7f6f30284e
commit fc248069e9
5 changed files with 36 additions and 6 deletions

View File

@@ -3758,7 +3758,9 @@ mysql_init_select(LEX *lex)
{
SELECT_LEX *select_lex= lex->current_select;
select_lex->init_select();
select_lex->select_limit= lex->thd->variables.select_limit;
select_lex->select_limit= (&lex->select_lex == select_lex) ?
lex->thd->variables.select_limit : /* Primry UNION */
HA_POS_ERROR; /* subquery */
if (select_lex == &lex->select_lex)
{
lex->exchange= 0;
@@ -3810,7 +3812,9 @@ mysql_new_select(LEX *lex, bool move_down)
fake->select_number= INT_MAX;
fake->make_empty_select();
fake->linkage= GLOBAL_OPTIONS_TYPE;
fake->select_limit= lex->thd->variables.select_limit;
fake->select_limit= (&lex->unit == unit) ?
lex->thd->variables.select_limit : /* Primry UNION */
HA_POS_ERROR; /* subquery */
}
}