diff options
author | unknown <acurtis@xiphis.org> | 2005-05-24 11:44:34 +0100 |
---|---|---|
committer | unknown <acurtis@xiphis.org> | 2005-05-24 11:44:34 +0100 |
commit | efc7b884ebaa81416743b98fdbf909189443e70a (patch) | |
tree | 6ac4b96fa2cc48da8e8b1d95d98e839fbceb877d /sql | |
parent | b6c1f2302ab77e6cfd37bd05f8444ff0c82bc459 (diff) | |
download | mariadb-git-efc7b884ebaa81416743b98fdbf909189443e70a.tar.gz |
Bug#7241 - Invalid response when DELETE .. USING and LOCK TABLES used.
Only acquire necessary write lock for multi-delete
mysql-test/r/lock.result:
Test for Bug#7241
mysql-test/t/lock.test:
Test for Bug#7241
sql/sql_parse.cc:
Bug#7241
Don't acquire write lock on all tables.
Make sure to set lock_type on real table_list
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_parse.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c5b429ec8fc..2c1723be5d9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4141,6 +4141,7 @@ void mysql_init_multi_delete(LEX *lex) lex->select_lex.select_limit= lex->unit.select_limit_cnt= HA_POS_ERROR; lex->select_lex.table_list.save_and_clear(&lex->auxilliary_table_list); + lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ; } @@ -5437,6 +5438,11 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) } walk->lock_type= target_tbl->lock_type; target_tbl->table_list= walk; // Remember corresponding table + if (walk->table_list) + { + target_tbl->table_list= walk->table_list; + walk->table_list->lock_type= walk->lock_type; + } } DBUG_RETURN(0); } |