summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <davi@moksha.local>2007-08-16 14:51:37 -0300
committerunknown <davi@moksha.local>2007-08-16 14:51:37 -0300
commit409938f22a6b383bc987a4463aef60483f458394 (patch)
treec6387b21af93f5dbd4171e67e74b4490d4e7996e
parenta0ed0ea12870e87316f9086b8a1152eb6c4c2b8b (diff)
downloadmariadb-git-409938f22a6b383bc987a4463aef60483f458394.tar.gz
Bug#29936 (Stored Procedure DML ignores low_priority_updates setting)
This is a follow up for the patch for Bug#26162 "Trigger DML ignores low_priority_updates setting", where the stored procedure ignores the session setting of low_priority_updates. For every table open operation with default write (TL_WRITE_DEFAULT) lock_type, downgrade the lock type to the session setting of low_priority_updates. sql/lock.cc: Add late lock_type assertion. sql/sql_base.cc: Possibly downgrade lock type to the the session setting of low_priority_updates and also remove early assertion.
-rw-r--r--sql/lock.cc1
-rw-r--r--sql/sql_base.cc9
2 files changed, 3 insertions, 7 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index f730ac56d35..0036d0aef77 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -730,6 +730,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
continue;
lock_type= table->reginfo.lock_type;
+ DBUG_ASSERT (lock_type != TL_WRITE_DEFAULT);
if (lock_type >= TL_WRITE_ALLOW_WRITE)
{
*write_lock_used=table;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 1c01248c283..0477c40b42d 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1537,7 +1537,6 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
HASH_SEARCH_STATE state;
DBUG_ENTER("open_table");
- DBUG_ASSERT (table_list->lock_type != TL_WRITE_DEFAULT);
/* find a unused table in the open table cache */
if (refresh)
*refresh=0;
@@ -2708,11 +2707,6 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
{
safe_to_ignore_table= FALSE;
- if (tables->lock_type == TL_WRITE_DEFAULT)
- {
- tables->lock_type= thd->update_lock_default;
- DBUG_ASSERT (tables->lock_type >= TL_WRITE_ALLOW_WRITE);
- }
/*
Ignore placeholders for derived tables. After derived tables
processing, link to created temporary table will be put here.
@@ -2857,7 +2851,8 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
}
if (tables->lock_type != TL_UNLOCK && ! thd->locked_tables)
- tables->table->reginfo.lock_type=tables->lock_type;
+ tables->table->reginfo.lock_type= tables->lock_type == TL_WRITE_DEFAULT ?
+ thd->update_lock_default : tables->lock_type;
tables->table->grant= tables->grant;
process_view_routines: