1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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

@ -1008,6 +1008,7 @@ void st_select_lex_unit::init_query()
union_result= 0;
table= 0;
fake_select_lex= 0;
found_rows_for_union= 0;
}
void st_select_lex::init_query()
@ -1609,6 +1610,17 @@ void st_select_lex::print_limit(THD *thd, String *str)
}
}
void st_select_lex_unit::set_limit(ha_rows limit, ha_rows offset,
SELECT_LEX *sl)
{
offset_limit_cnt= offset;
select_limit_cnt= limit+offset;
if (select_limit_cnt < limit)
select_limit_cnt= HA_POS_ERROR; // no limit
if (select_limit_cnt == HA_POS_ERROR)
sl->options&= ~OPTION_FOUND_ROWS;
}
/*
There are st_select_lex::add_table_to_list &
st_select_lex::set_lock_for_tables in sql_parse.cc