postgres: Use timestamp comparison instead of timezone offset comparison for detecting the default timestamp

refs #7919
This commit is contained in:
Eric Lippmann 2015-01-19 13:50:03 +01:00
parent 09d5ec6b7a
commit 56640fa64f
1 changed files with 2 additions and 2 deletions

View File

@ -324,8 +324,8 @@ abstract class IdoQuery extends DbQuery
$value = preg_replace('/ COLLATE .+$/', '', $value);
$value = preg_replace('/inet_aton\(([[:word:].]+)\)/i', '$1::inet - \'0.0.0.0\'', $value);
$value = preg_replace(
'/(UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\)))/i',
'CASE WHEN ($1 = EXTRACT(TIMEZONE FROM NOW()) * -1) THEN 0 ELSE $1 END',
'/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',
'CASE WHEN ($1 < \'1970-01-03 00:00:00+00\'::timestamp with time zone) THEN 0 ELSE UNIX_TIMESTAMP($1) END',
$value
);
}