mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Postgres booleans should return as int for consistency
This commit is contained in:
parent
2c207b636a
commit
da1af3d8b0
@ -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