mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8934 from creative-commoners/pulls/4.4/pdostgresql-boolean-consistency
FIX Postgres booleans should return as int for consistency
This commit is contained in:
commit
155a9bb1f9
@ -47,6 +47,7 @@ class PDOStatementHandle
|
||||
'float8' => 'float',
|
||||
'float16' => 'float',
|
||||
'numeric' => 'float',
|
||||
'bool' => 'int', // Bools should be ints
|
||||
|
||||
// MySQL
|
||||
'NEWDECIMAL' => 'float',
|
||||
|
@ -267,5 +267,9 @@ class DatabaseTest extends SapphireTest
|
||||
|
||||
// Dates are returned as strings
|
||||
$this->assertInternalType('string', $record['Created'], 'DBDatetime fields should be string (non-prepared)');
|
||||
|
||||
// Booleans selected directly are ints
|
||||
$result = DB::query('SELECT TRUE')->first();
|
||||
$this->assertInternalType('int', reset($result));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user