From ee9044bbba91103da635d8ae43346ef6b425b43d Mon Sep 17 00:00:00 2001 From: wangbincmss <30889492+wangbincmss@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:35:07 +0800 Subject: [PATCH] PS-9163 MySQLv5.7 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f87bb25e50e1..2633159df05c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3856,7 +3856,8 @@ trx_is_strict( /*==========*/ trx_t* trx) /*!< in: transaction */ { - return(trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode)); + return(trx && trx->mysql_thd && THDVAR(trx->mysql_thd, strict_mode) && + (!thd_slave_thread(trx->mysql_thd))); } /**************************************************************//**