diff options
Diffstat (limited to 'storage/xtradb/handler/ha_innodb.cc')
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 078795786fc..4a6a6a01357 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -7342,8 +7342,12 @@ ha_innobase::innobase_lock_autoinc(void) old style only if another transaction has already acquired the AUTOINC lock on behalf of a LOAD FILE or INSERT ... SELECT etc. type of statement. */ + + /* If this is (single/multi) row INSERTs/REPLACEs, or + slave thread executing Write_rows_log_event */ if (thd_sql_command(user_thd) == SQLCOM_INSERT - || thd_sql_command(user_thd) == SQLCOM_REPLACE) { + || thd_sql_command(user_thd) == SQLCOM_REPLACE + || (thd_slave_thread(user_thd) && thd_sql_command(user_thd) == SQLCOM_END)) { dict_table_t* ib_table = prebuilt->table; /* Acquire the AUTOINC mutex. */ @@ -7355,6 +7359,8 @@ ha_innobase::innobase_lock_autoinc(void) /* Release the mutex to avoid deadlocks. */ dict_table_autoinc_unlock(ib_table); } else { + /* Do not fall back to old style autoinc + locking */ break; } } |