diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 1cdb1ddc1..749b9d0a6 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -238,7 +238,7 @@ class DboMysql extends DboSource { foreach ($this->map as $col => $meta) { list($table, $column, $type) = $meta; $resultRow[$table][$column] = $row[$col]; - if ($type == 'boolean') { + if ($type == 'boolean' && !is_null($row[$col])) { $resultRow[$table][$column] = $this->boolean($resultRow[$table][$column]); } } diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php b/cake/libs/model/datasources/dbo/dbo_postgres.php index b6106d87b..9a397a0cc 100644 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php @@ -707,7 +707,7 @@ class DboPostgres extends DboSource { switch ($type) { case 'bool': - $resultRow[$table][$column] = $this->boolean($row[$index]); + $resultRow[$table][$column] = is_null($row[$index]) ? null : $this->boolean($row[$index]); break; case 'binary': case 'bytea': diff --git a/cake/libs/model/datasources/dbo/dbo_sqlite.php b/cake/libs/model/datasources/dbo/dbo_sqlite.php index ae5c25f11..63e1a1e40 100644 --- a/cake/libs/model/datasources/dbo/dbo_sqlite.php +++ b/cake/libs/model/datasources/dbo/dbo_sqlite.php @@ -336,7 +336,7 @@ class DboSqlite extends DboSource { foreach ($this->map as $col => $meta) { list($table, $column, $tpye) = $meta; $resultRow[$table][$column] = $row[$col]; - if ($type === 'boolean') { + if ($type == 'boolean' && !is_null($row[$col])) { $resultRow[$table][$column] = $this->boolean($resultRow[$table][$column]); } }