summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-10-14 00:02:38 +0300
committerunknown <bell@sanja.is.com.ua>2005-10-14 00:02:38 +0300
commit00695490214aca1016e7ecb09a3b142903b1fe78 (patch)
tree478abed536fff8ef1821409f7c91a904a06a3928 /sql/sql_update.cc
parentc8067ec8489dfc1ee96ba89100a9ef067578ffca (diff)
downloadmariadb-git-00695490214aca1016e7ecb09a3b142903b1fe78.tar.gz
- set 'updating' in both tables list if we have two of them (because of subquery) (BUG#13236)
- fixed test mysql-test/r/rpl_multi_update2.result: fixed setting/reseting environment multi-update with subquery added mysql-test/t/rpl_multi_update2.test: fixed setting/reseting environment multi-update with subquery added sql/sql_update.cc: set 'updating' in both tables list if we have two of them (because of subquery)
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index a978a5edc64..ca40ed554dd 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -569,7 +569,9 @@ int mysql_multi_update_lock(THD *thd,
}
DBUG_PRINT("info",("setting table `%s` for update", tl->alias));
tl->lock_type= thd->lex->multi_lock_option;
- tl->updating= 1;
+ tl->updating= 1; // loacal or only list
+ if (tl->table_list)
+ tl->table_list->updating= 1; // global list (if we have 2 lists)
wants= UPDATE_ACL;
}
else
@@ -579,7 +581,9 @@ int mysql_multi_update_lock(THD *thd,
// correct order of statements. Otherwise, we use a TL_READ lock to
// improve performance.
tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ;
- tl->updating= 0;
+ tl->updating= 0; // loacal or only list
+ if (tl->table_list)
+ tl->table_list->updating= 0; // global list (if we have 2 lists)
wants= SELECT_ACL;
}