summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-05-05 21:21:41 +0300
committerunknown <bell@sanja.is.com.ua>2004-05-05 21:21:41 +0300
commitf6428e8bb9ac0cad24465513c5969a50cd13f6f2 (patch)
treedc6fc7f740dabf7da6ce3e21af3673dc04bbd8fd /sql/sql_update.cc
parentea646dce60994b8a5d36d575ed371144cd01eeb3 (diff)
downloadmariadb-git-f6428e8bb9ac0cad24465513c5969a50cd13f6f2.tar.gz
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
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index d985d2c2e78..d71744d8361 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -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