Permalink
Browse files

Explicitly using a fetch mode in SQLServer, not doing it causes serio…

…us memory leaks
  • Loading branch information...
1 parent cd562f5 commit ba097d404fecc1336526fbd9485ef087eabe8886 @lorenzo lorenzo committed Jan 7, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -182,7 +182,7 @@ public function listSources($data = null) {
} else {
$tables = array();
- while ($line = $result->fetch()) {
+ while ($line = $result->fetch(PDO::FETCH_NUM)) {
$tables[] = $line[0];
}
@@ -222,7 +222,7 @@ public function describe($model) {
throw new CakeException(__d('cake_dev', 'Could not describe table for %s', $table));
}
- foreach ($cols as $column) {
+ while ($column = $cols->fetch(PDO::FETCH_OBJ)) {
$field = $column->Field;
$fields[$field] = array(
'type' => $this->column($column),

0 comments on commit ba097d4

Please sign in to comment.