Skip to content

Commit

Permalink
Explicitly using a fetch mode in SQLServer, not doing it causes serio…
Browse files Browse the repository at this point in the history
…us memory leaks
  • Loading branch information
lorenzo committed Jan 7, 2012
1 parent cd562f5 commit ba097d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Model/Datasource/Database/Sqlserver.php
Expand Up @@ -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];
}

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit ba097d4

Please sign in to comment.