From fcbcd146782e0765867bcb52049cd255b96c31ac Mon Sep 17 00:00:00 2001 From: Filippo Tessarotto Date: Mon, 21 Oct 2024 09:47:22 +0200 Subject: [PATCH] Clone the cache instance so it doesn't get changed by the Result operations on it --- src/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Connection.php b/src/Connection.php index 5a66e1ad21..a81e57e2c7 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -811,7 +811,7 @@ public function executeCacheQuery(string $sql, array $params, array $types, Quer } if (isset($value[$realKey]) && $value[$realKey] instanceof ArrayResult) { - return new Result($value[$realKey], $this); + return new Result(clone $value[$realKey], $this); } } else { $value = []; @@ -837,7 +837,7 @@ public function executeCacheQuery(string $sql, array $params, array $types, Quer $resultCache->save($item); - return new Result($value[$realKey], $this); + return new Result(clone $value[$realKey], $this); } /**