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

limit initialization moved to method of SELECT_LEX_UNIT (WL#695)

(SCRUM)
counters was not moved to SELECT_LEX because it used in methods inherited from select_result which should be applied to whole union results


mysql-test/r/union.result:
  this is results is true
sql/item_subselect.cc:
  limit initialization moved to method of SELECT_LEX_UNIT
sql/sql_derived.cc:
  limit initialization moved to method of SELECT_LEX_UNIT
sql/sql_lex.cc:
  limit initialization moved to method of SELECT_LEX_UNIT
sql/sql_lex.h:
  limit initialization moved to method of SELECT_LEX_UNIT
sql/sql_parse.cc:
  limit initialization moved to handle_select for single select (UNIONs already have it)
sql/sql_select.cc:
  limit initialization moved to method of SELECT_LEX_UNIT
sql/sql_union.cc:
  layout fixed
  limit initialization moved to method of SELECT_LEX_UNIT
This commit is contained in:
unknown
2003-11-21 21:19:56 +02:00
parent afe2186e3b
commit f28b5e6e91
8 changed files with 58 additions and 59 deletions

View File

@ -1843,18 +1843,6 @@ mysql_execute_command(THD *thd)
break; // Error message is given
}
#endif
/*
In case of single SELECT unit->global_parameters points on first SELECT
TODO: move counters to SELECT_LEX
*/
unit->offset_limit_cnt= (ha_rows) unit->global_parameters->offset_limit;
unit->select_limit_cnt= (ha_rows) (unit->global_parameters->select_limit+
unit->global_parameters->offset_limit);
if (unit->select_limit_cnt <
(ha_rows) unit->global_parameters->select_limit)
unit->select_limit_cnt= HA_POS_ERROR; // no limit
if (unit->select_limit_cnt == HA_POS_ERROR && !select_lex->next_select())
select_lex->options&= ~OPTION_FOUND_ROWS;
if (!(res=open_and_lock_tables(thd,tables)))
{
@ -2188,11 +2176,8 @@ mysql_execute_command(THD *thd)
}
#endif
select_lex->options|= SELECT_NO_UNLOCK;
unit->offset_limit_cnt= select_lex->offset_limit;
unit->select_limit_cnt= select_lex->select_limit+
select_lex->offset_limit;
if (unit->select_limit_cnt < select_lex->select_limit)
unit->select_limit_cnt= HA_POS_ERROR; // No limit
unit->set_limit(select_lex->select_limit, select_lex->offset_limit,
select_lex);
/* Skip first table, which is the table we are creating */
lex->select_lex.table_list.first=