Skip to content

Commit

Permalink
Fix null bytea columns.
Browse files Browse the repository at this point in the history
Apply patch from 'opiazer'  Fixes #2432
  • Loading branch information
markstory committed Jan 4, 2012
1 parent 101148c commit c43b099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -716,7 +716,7 @@ public function fetchResult() {
break;
case 'binary':
case 'bytea':
$resultRow[$table][$column] = stream_get_contents($row[$index]);
$resultRow[$table][$column] = is_null($row[$index]) ? null : stream_get_contents($row[$index]);
break;
default:
$resultRow[$table][$column] = $row[$index];
Expand Down
Expand Up @@ -759,7 +759,7 @@ public function testVirtualFields() {
*/
function testVirtualFieldAsAConstant() {
$this->loadFixtures('Article', 'Comment');
$Article =& ClassRegistry::init('Article');
$Article = ClassRegistry::init('Article');
$Article->virtualFields = array(
'empty' => "NULL",
'number' => 43,
Expand Down

0 comments on commit c43b099

Please sign in to comment.