Skip to content

Commit

Permalink
Clone the cache instance so it doesn't get changed by the Result oper…
Browse files Browse the repository at this point in the history
…ations on it
  • Loading branch information
Slamdunk committed Oct 21, 2024
1 parent efed5cd commit fcbcd14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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);
}

/**
Expand Down

0 comments on commit fcbcd14

Please sign in to comment.