summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2022-03-02 21:29:53 +0300
committerVlad Lesin <vlad_lesin@mail.ru>2022-03-10 15:38:43 +0300
commit1766a18e06a056155031dabefb88ce7f201ad921 (patch)
treef3f15e182dae7e881ab6d1146990e0e18d2c6b7c /storage
parente7cf871dda59ad39c9125288149a4ec38518d41c (diff)
downloadmariadb-git-1766a18e06a056155031dabefb88ce7f201ad921.tar.gz
MDEV-19577 Replication does not work with innodb_autoinc_lock_mode=2
The first step for deprecating innodb_autoinc_lock_mode(see MDEV-27844) is: - to switch statement binlog format to ROW if binlog format is MIXED and the statement changes autoincremented fields - issue warnings if innodb_autoinc_lock_mode == 2 and binlog format is STATEMENT
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc8
-rw-r--r--storage/innobase/handler/ha_innodb.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 33aafa00113..02ac53e22dd 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -9594,6 +9594,14 @@ ha_innobase::change_active_index(
DBUG_RETURN(0);
}
+/* @return true if it's necessary to switch current statement log format from
+STATEMENT to ROW if binary log format is MIXED and autoincrement values
+are changed in the statement */
+bool ha_innobase::autoinc_lock_mode_stmt_unsafe() const
+{
+ return innobase_autoinc_lock_mode == AUTOINC_NO_LOCKING;
+}
+
/***********************************************************************//**
Reads the next or previous row from a cursor, which must have previously been
positioned using index_read.
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 9468edcf226..9356b269fcc 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -448,6 +448,10 @@ protected:
int general_fetch(uchar* buf, uint direction, uint match_mode);
int change_active_index(uint keynr);
+ /* @return true if it's necessary to switch current statement log
+ format from STATEMENT to ROW if binary log format is MIXED and
+ autoincrement values are changed in the statement */
+ bool autoinc_lock_mode_stmt_unsafe() const;
dict_index_t* innobase_get_index(uint keynr);
#ifdef WITH_WSREP