Commit 031f38c3 authored by Tiago Brito's avatar Tiago Brito

resolves #632 Fix null cast in boolean type in Postgres platform

parent f624876a
......@@ -722,7 +722,7 @@ class PostgreSqlPlatform extends AbstractPlatform
private function convertSingleBooleanValue($value, $callback)
{
if (null === $value) {
return $callback(false);
return $callback(null);
}
if (is_bool($value) || is_numeric($value)) {
......@@ -786,6 +786,9 @@ class PostgreSqlPlatform extends AbstractPlatform
return $this->doConvertBooleans(
$item,
function ($boolean) {
if (is_null($boolean)) {
return 'NULL';
}
return true === $boolean ? 'true' : 'false';
}
);
......@@ -803,7 +806,7 @@ class PostgreSqlPlatform extends AbstractPlatform
return $this->doConvertBooleans(
$item,
function ($boolean) {
return (int) $boolean;
return is_null($boolean) ? null : (int) $boolean;
}
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment