Fix null bytea columns.

Apply patch from 'opiazer'  Fixes #2432
This commit is contained in:
mark_story 2012-01-03 20:32:34 -05:00
parent 101148c10f
commit c43b099894
2 changed files with 2 additions and 2 deletions

View file

@ -716,7 +716,7 @@ class Postgres extends DboSource {
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];

View file

@ -759,7 +759,7 @@ class PostgresTest extends CakeTestCase {
*/
function testVirtualFieldAsAConstant() {
$this->loadFixtures('Article', 'Comment');
$Article =& ClassRegistry::init('Article');
$Article = ClassRegistry::init('Article');
$Article->virtualFields = array(
'empty' => "NULL",
'number' => 43,