You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #61085 [Lock] Fix using fractional TTLs (manuelderuiter)
This PR was merged into the 6.4 branch.
Discussion
----------
[Lock] Fix using fractional TTLs
Discussion
----------
Solves issue #59938
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | n/a
| License | MIT
When using the PostgreSQLDBALStore with Scheduler it will cast an invalid result. Scheduler generates a TTL as float and PostgreSQL expects an integer.
https://github.com/manuelderuiter/symfony_59938/actions/runs/16187766978
after the fix
https://github.com/manuelderuiter/symfony_59938/actions/runs/16187926234
Commits
-------
2d329a2 [Lock] Fix using fractional TTLs on all platforms
d22544c [Lock] Fixes an issue with PostgreSQL when using fractional TTLs
$platforminstanceof \Doctrine\DBAL\Platforms\PostgreSQLPlatform => 'CAST(EXTRACT(epoch FROM NOW()) AS DOUBLE PRECISION)',
262
+
$platforminstanceof \Doctrine\DBAL\Platforms\OraclePlatform => "(CAST(systimestamp AT TIME ZONE 'UTC' AS DATE) - DATE '1970-01-01') * 86400 + TO_NUMBER(TO_CHAR(systimestamp AT TIME ZONE 'UTC', 'SSSSS.FF'))",
'pgsql' => 'CAST(EXTRACT(epoch FROM NOW()) AS DOUBLE PRECISION)',
235
+
'oci' => "(CAST(systimestamp AT TIME ZONE 'UTC' AS DATE) - DATE '1970-01-01') * 86400 + TO_NUMBER(TO_CHAR(systimestamp AT TIME ZONE 'UTC', 'SSSSS.FF'))",
236
+
'sqlsrv' => "CAST(DATEDIFF_BIG(ms, '1970-01-01', SYSUTCDATETIME()) AS FLOAT) / 1000.0",
237
+
default => (new \DateTimeImmutable())->format('U.u'),
0 commit comments