Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
Subqueries should clone QueryBuilder object
Browse files Browse the repository at this point in the history
  • Loading branch information
Nik Barham committed Apr 12, 2018
1 parent f048370 commit a1e6d5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/QueryBuilder/SubQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SubQuery extends Table
public function __construct($query, ?string $alias = 'subquery')
{
if ($query instanceof QueryBuilder) {
$this->sub = $query;
$this->sub = clone $query;
} elseif ($query instanceof SqlString) {
$this->sql = (string) $query;
} elseif (is_string($query)) {
Expand Down

0 comments on commit a1e6d5d

Please sign in to comment.