From 564877c579b948e7e92b3ff04dda6c382f95e8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 6 Feb 2023 14:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Connection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Connection.php b/Connection.php index cd7c5e3..c2e079c 100644 --- a/Connection.php +++ b/Connection.php @@ -264,7 +264,7 @@ class Connection extends Component { $connections = $this->connection; $cds = ($this->slaveConfig['cds'] ?? $this->cds) . ($isMaster ? 'master' : 'slave'); - if (!$pdo->inTransaction()) { + if ($isMaster && !$pdo->inTransaction()) { $connections->addItem($cds, $pdo); } }