diff --git a/MysqliDb.php b/MysqliDb.php index f64c00a0..2b2d6600 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1731,7 +1731,7 @@ public static function subQuery($subQueryAlias = "") public function copy() { $copy = unserialize(serialize($this)); - $copy->_mysqli = $this->_mysqli; + $copy->_mysqli = null; return $copy; } diff --git a/tests/mysqliDbTests.php b/tests/mysqliDbTests.php index f1fa9efa..cc993391 100644 --- a/tests/mysqliDbTests.php +++ b/tests/mysqliDbTests.php @@ -360,6 +360,8 @@ function createTable ($name, $data) { echo "copy with subquery count failed"; exit; } +unset ($cnt); + $data = $db->get('users'); if (count($data) != 3) { echo "copy with subquery data count failed";