-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
PDO session timestamps out of range for postgres #24456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What does your schema look like? |
It works on sqlfiddle. http://sqlfiddle.com/#!17/52d8c/2 |
insert into sessions values ('abc', 2147483647, 1440); |
ses_lifetime = 2147483647 and you reproduce problem |
That's just the standard https://en.wikipedia.org/wiki/Year_2038_problem hit now if you use big lifetimes. So the proper fix might to use bigger integer column. As your solution will give you another 20 years to hit the problem again, it's better than nothing. ;) |
it's standard practice for unlimited sessions |
This PR was merged into the 2.7 branch. Discussion ---------- pdo session fix | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24456 | License | MIT | Doc PR | Fix PDO session timestamp out of range for postgres. (branch from 2.7) P.S. please delete this pull #24457 Commits ------- 56b29a7 pdo session fix
…n Pdo driver The initial fix for symfony#24456 was wrong, since it only accounted for Postgres. @WhiteEagle88 correctly identified symfony#25665 - but having time as SIGNED is ... off, since time shouldn't be negative. Using CAST to solve this issue surely has a performance penalty, so I believe the best approach is to have a switch based on the driver.
…ed on Pdo driver (tanasecosminromeo) This PR was submitted for the master branch but it was squashed and merged into the 2.7 branch instead (closes #25922). Discussion ---------- [HttpFoundation] Use the correct syntax for session gc based on Pdo driver | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25665 #24456 | License | MIT | Doc PR | The initial fix for #24456 was wrong, since it only accounted for Postgres. @WhiteEagle88 correctly identified #25665 - but having time as SIGNED is ... off, since time shouldn't be negative. Using CAST to solve this issue surely has a performance penalty, so I believe the best approach is to have a switch based on the driver. Commits ------- 826dfbd [HttpFoundation] Use the correct syntax for session gc based on Pdo driver
With using PDO session handler with Postgres: PDO SQL error in PdoSessionHandler->close() - integer out of range, if gc_maxlifetime in php.ini with default value.
The text was updated successfully, but these errors were encountered: