1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-03 05:41:09 +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

@@ -544,7 +544,7 @@ int mysql_multi_update(THD *thd,
}
}
if (!(result=new multi_update(thd, table_list, fields, values,
if (!(result=new multi_update(thd, update_list, fields, values,
handle_duplicates)))
DBUG_RETURN(-1);
@@ -578,7 +578,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
int multi_update::prepare(List<Item> &not_used_values,
SELECT_LEX_UNIT *lex_unit)
{
TABLE_LIST *table_ref, *tables;
TABLE_LIST *table_ref;
SQL_LIST update;
table_map tables_to_update= 0;
Item_field *item;
@@ -604,9 +604,8 @@ int multi_update::prepare(List<Item> &not_used_values,
We have to check values after setup_tables to get used_keys right in
reference tables
*/
tables= thd->lex->select_lex.get_table_list();
if (setup_fields(thd, 0, tables, *values, 1, 0, 0))
if (setup_fields(thd, 0, all_tables, *values, 1, 0, 0))
DBUG_RETURN(1);
/*
@@ -616,7 +615,7 @@ int multi_update::prepare(List<Item> &not_used_values,
*/
update.empty();
for (table_ref= tables; table_ref; table_ref=table_ref->next)
for (table_ref= all_tables; table_ref; table_ref=table_ref->next)
{
TABLE *table=table_ref->table;
if (tables_to_update & table->map)
@@ -685,10 +684,10 @@ int multi_update::prepare(List<Item> &not_used_values,
which will cause an error when reading a row.
(This issue is mostly relevent for MyISAM tables)
*/
for (table_ref= tables; table_ref; table_ref=table_ref->next)
for (table_ref= all_tables; table_ref; table_ref=table_ref->next)
{
TABLE *table=table_ref->table;
if (!(tables_to_update & table->map) || !table->no_keyread &&
if (!(tables_to_update & table->map) &&
find_real_table_in_list(update_tables, table_ref->db,
table_ref->real_name))
table->no_cache= 1; // Disable row cache