mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Preventing memory leak in PDO when retrieving results from the driver, fixes #2293
This commit is contained in:
parent
5180540d1f
commit
2bffd4c26d
4 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue