Preventing memory leak in PDO when retrieving results from the driver, fixes #2293

This commit is contained in:
Jose Lorenzo Rodriguez 2011-11-25 13:35:32 -04:30
parent 5180540d1f
commit 2bffd4c26d
4 changed files with 4 additions and 4 deletions

View file

@ -238,7 +238,7 @@ class Mysql extends DboSource {
* @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch * @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch
*/ */
public function fetchResult() { public function fetchResult() {
if ($row = $this->_result->fetch()) { if ($row = $this->_result->fetch(PDO::FETCH_NUM)) {
$resultRow = array(); $resultRow = array();
foreach ($this->map as $col => $meta) { foreach ($this->map as $col => $meta) {
list($table, $column, $type) = $meta; list($table, $column, $type) = $meta;

View file

@ -707,7 +707,7 @@ class Postgres extends DboSource {
* @return array * @return array
*/ */
public function fetchResult() { public function fetchResult() {
if ($row = $this->_result->fetch()) { if ($row = $this->_result->fetch(PDO::FETCH_NUM)) {
$resultRow = array(); $resultRow = array();
foreach ($this->map as $index => $meta) { foreach ($this->map as $index => $meta) {

View file

@ -330,7 +330,7 @@ class Sqlite extends DboSource {
* @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch * @return mixed array with results fetched and mapped to column names or false if there is no results left to fetch
*/ */
public function fetchResult() { public function fetchResult() {
if ($row = $this->_result->fetch()) { if ($row = $this->_result->fetch(PDO::FETCH_NUM)) {
$resultRow = array(); $resultRow = array();
foreach ($this->map as $col => $meta) { foreach ($this->map as $col => $meta) {
list($table, $column, $type) = $meta; list($table, $column, $type) = $meta;

View file

@ -607,7 +607,7 @@ class Sqlserver extends DboSource {
* @return mixed * @return mixed
*/ */
public function fetchResult() { public function fetchResult() {
if ($row = $this->_result->fetch()) { if ($row = $this->_result->fetch(PDO::FETCH_NUM)) {
$resultRow = array(); $resultRow = array();
foreach ($this->map as $col => $meta) { foreach ($this->map as $col => $meta) {
list($table, $column, $type) = $meta; list($table, $column, $type) = $meta;