From c4222ab1fea0615ae8a378dfc000d1e8da2456cd Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 27 Dec 2024 17:32:43 -0500 Subject: [PATCH] Fix infinite loop issue. --- src/Db/Adapter/MysqlAdapter.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Db/Adapter/MysqlAdapter.php b/src/Db/Adapter/MysqlAdapter.php index 981585fb..3b5663b6 100644 --- a/src/Db/Adapter/MysqlAdapter.php +++ b/src/Db/Adapter/MysqlAdapter.php @@ -98,6 +98,7 @@ class MysqlAdapter extends PdoAdapter */ public function connect(): void { + $this->getConnection()->getDriver()->connect(); $this->setConnection($this->getConnection()); } @@ -1526,6 +1527,10 @@ public function getColumnTypes(): array */ protected function hasNativeUuid(): bool { + // Prevent infinite connect() loop when MysqlAdapter is used as a stub. + if ($this->connection === null || !$this->getOption('connection')) { + return false; + } $connection = $this->getConnection(); $version = $connection->getDriver()->version();