From baedda6cb91a594be027259db90ea891c52b01f2 Mon Sep 17 00:00:00 2001 From: wangbincmss <30889492+wangbincmss@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:29:34 +0800 Subject: [PATCH 1/4] PS-9163 MySQL replica encounter error when master and replica innodb_strict_mode=OFF when master and replica set global innodb_strict_mode=OFF; the master execute the SQL, but the slave thread in replica run error, because the innodb_strict_mode of slave thread doesn't change alse ON. --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 13454fad4c21..771b6dda0782 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3401,7 +3401,7 @@ bool trx_is_strict(trx_t *trx) /*!< in: transaction */ { /* Relax strict check if table is in truncate create table */ return (trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode) && - (!trx->in_truncate)); + (!trx->in_truncate) && (!thd_slave_thread(trx->mysql_thd))); } /** Resets some fields of a m_prebuilt struct. The template is used in fast From 8a3fa619f54afa8198e5d77ca6487a977166093b Mon Sep 17 00:00:00 2001 From: wangbincmss <30889492+wangbincmss@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:22:35 +0800 Subject: [PATCH 2/4] Update ha_innodb.cc Update ha_innodb.cc From 2e8cc8229a0247a249df56f30f59872a0bf23e1f Mon Sep 17 00:00:00 2001 From: wangbincmss <30889492+wangbincmss@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:24:27 +0800 Subject: [PATCH 3/4] Update ha_innodb.cc Update ha_innodb.cc From ed5220c83046b28cbd36b7fec07b753eea3391b9 Mon Sep 17 00:00:00 2001 From: wangbincmss <30889492+wangbincmss@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:17:05 +0800 Subject: [PATCH 4/4] Update ha_innodb.cc --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 771b6dda0782..da16fa239ee5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3401,7 +3401,7 @@ bool trx_is_strict(trx_t *trx) /*!< in: transaction */ { /* Relax strict check if table is in truncate create table */ return (trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode) && - (!trx->in_truncate) && (!thd_slave_thread(trx->mysql_thd))); + (!trx->in_truncate) && !thd_slave_thread(trx->mysql_thd)); } /** Resets some fields of a m_prebuilt struct. The template is used in fast