Merge pull request #93 from sminnee/fix-boolean-coersion

FIX: Boolean ’t’/‘f’ strings need to be coerced to int properly.
This commit is contained in:
Robbie Averill 2019-01-23 11:16:53 +02:00 committed by GitHub
commit f85b46d047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -80,7 +80,11 @@ class PostgreSQLQuery extends Query
$record[$k] = $v;
$type = pg_field_type($this->handle, $i);
if (isset(self::$typeMapping[$type])) {
settype($record[$k], self::$typeMapping[$type]);
if ($type === 'bool' && $record[$k] === 't') {
$record[$k] = 1;
} else {
settype($record[$k], self::$typeMapping[$type]);
}
}
}