summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index b1b30a29639..b2b10a9b59a 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -473,7 +473,10 @@ int mysql_multi_update_lock(THD *thd,
else
{
DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias));
- tl->lock_type= TL_READ;
+ // If we are using the binary log, we need TL_READ_NO_INSERT to get
+ // 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;
wants= SELECT_ACL;
}