1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#7241 - Invalid response when DELETE .. USING and LOCK TABLES used.

Only acquire necessary write lock for multi-delete
This commit is contained in:
acurtis@xiphis.org
2005-05-24 11:44:34 +01:00
parent 76a20eb397
commit a6a589ef76
3 changed files with 30 additions and 0 deletions

View File

@ -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);
}