1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

caching of queries with isammerge tables forbiden using general way

SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause
correct table list passed to class constructor of select_update


mysql-test/r/subselect.result:
  do not show limit if it is not explicit
mysql-test/r/union.result:
  test of LIMIT + ORDER
mysql-test/t/union.test:
  test of LIMIT + ORDER
sql/ha_isammrg.h:
  caching of queries with isammerge tables forbiden
sql/sql_cache.cc:
  removed check on isammerge
sql/sql_lex.cc:
  tag of explicit limit in statement
sql/sql_lex.h:
  tag of explicit limit in statement
sql/sql_parse.cc:
  blanks in empty line removed
  no limit by default (SQL_SELECT_LIMIT as default will be applied only for SELECT statement if there was not explicit LIMIT clause)
sql/sql_union.cc:
  reverted incorrect patch
sql/sql_update.cc:
  reverted incorrect patch
  correct table list passed to class constructor
sql/sql_yacc.yy:
  explicit LIMIT marked
This commit is contained in:
unknown
2004-05-05 21:21:41 +03:00
parent ea646dce60
commit f6428e8bb9
11 changed files with 72 additions and 48 deletions

View File

@@ -377,21 +377,12 @@ int st_select_lex_unit::exec()
if (!thd->is_fatal_error) // Check if EOM
{
ulong options_tmp= thd->options;
/*
We have to take into the account a case when:
SET SQL_SELECT_LIMIT was set.
In mysql_new_select() function this value was copied to
the fake_select_lex node of the top-level unit.
Here below, we just take this value if global LIMIT was not applied
to the entire UNION.
*/
ha_rows select_limit= ((global_parameters->select_limit != HA_POS_ERROR) ?
global_parameters->select_limit : fake_select_lex->select_limit);
thd->lex->current_select= fake_select_lex;
offset_limit_cnt= global_parameters->offset_limit;
select_limit_cnt= select_limit + global_parameters->offset_limit;
select_limit_cnt= global_parameters->select_limit +
global_parameters->offset_limit;
if (select_limit_cnt < select_limit)
if (select_limit_cnt < global_parameters->select_limit)
select_limit_cnt= HA_POS_ERROR; // no limit
if (select_limit_cnt == HA_POS_ERROR)
options_tmp&= ~OPTION_FOUND_ROWS;