diff options
author | unknown <bell@sanja.is.com.ua> | 2004-05-05 21:24:13 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-05-05 21:24:13 +0300 |
commit | 2c95f97c2beea7b88378623d9655fcf2ad88a9a9 (patch) | |
tree | b08dcc78213fe6542cd07701d30fdab61f2ac232 /sql/sql_update.cc | |
parent | b30d0883b1e87df5a476a9e48542321de4384aa4 (diff) | |
parent | f6428e8bb9ac0cad24465513c5969a50cd13f6f2 (diff) | |
download | mariadb-git-2c95f97c2beea7b88378623d9655fcf2ad88a9a9.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-ndb-4.1
mysql-test/r/subselect.result:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 3ae4ecad1e6..2428aac2da5 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -542,7 +542,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); @@ -576,7 +576,7 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list, int multi_update::prepare(List<Item> ¬_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; @@ -602,9 +602,8 @@ int multi_update::prepare(List<Item> ¬_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); /* @@ -614,7 +613,7 @@ int multi_update::prepare(List<Item> ¬_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) @@ -683,10 +682,10 @@ int multi_update::prepare(List<Item> ¬_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 |