From 560fa8c6c94809a54a343f0f2526a1daa45e2145 Mon Sep 17 00:00:00 2001 From: marcelovsantos Date: Fri, 16 Sep 2016 09:32:43 -0300 Subject: [PATCH] Added support to multiples resultset Fixed when run a store procedure with multiples resultset, and only first resultset is returned. --- Database/SybaseConnection.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Database/SybaseConnection.php b/Database/SybaseConnection.php index f147c03..854a774 100644 --- a/Database/SybaseConnection.php +++ b/Database/SybaseConnection.php @@ -20,7 +20,7 @@ class SybaseConnection extends Connection { * * @throws \Exception */ - public function transaction(Closure $callback) + public function transaction(Closure $callback, $attempts = 1) { if ($this->getDriverName() == 'sqlsrv') { @@ -372,7 +372,12 @@ public function select($query, $bindings = array(), $useReadPdo = true) if($offset>0){ return $this->compileOffset($offset, $query, $bindings, $me); }else{ - return $this->getPdo()->query($this->compileNewQuery($query, $bindings))->fetchAll($me->getFetchMode()); + $result = []; + $statement = $this->getPdo()->query($this->compileNewQuery($query, $bindings)); + do { + $result+= $statement->fetchAll($me->getFetchMode()); + } while ($statement->nextRowset()); + return $result; } }); } @@ -398,4 +403,4 @@ public function affectingStatement($query, $bindings = array()) return $this->getPdo()->query($this->compileNewQuery($query, $bindings))->rowCount(); }); } -} \ No newline at end of file +}