Skip to content
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

PDO session timestamps out of range for MySQL #25665

Closed
WhiteEagle88 opened this issue Jan 3, 2018 · 0 comments
Closed

PDO session timestamps out of range for MySQL #25665

WhiteEagle88 opened this issue Jan 3, 2018 · 0 comments

Comments

@WhiteEagle88
Copy link

Q A
Bug report? yes
Feature request? no
BC Break report? yes/no
RFC? no
Symfony version 2.6+

After fix #24456, problem arose for MySQL. Because MySQL cast the result of the expression to unsigned types and in the case where sess_time < current time. Mysql throws an error:

SQLSTATE[22003]: Numeric value out of range: 1690 BIGINT UNSIGNED value is out of range in '(1514967355 - `demo`.`sessions`.`sess_time`)'
WhiteEagle88 pushed a commit to WhiteEagle88/symfony that referenced this issue Jan 3, 2018
WhiteEagle88 pushed a commit to WhiteEagle88/symfony that referenced this issue Jan 10, 2018
WhiteEagle88 pushed a commit to WhiteEagle88/symfony that referenced this issue Jan 10, 2018
tanasecosminromeo added a commit to tanasecosminromeo/symfony that referenced this issue Jan 25, 2018
tanasecosminromeo added a commit to tanasecosminromeo/symfony that referenced this issue Jan 25, 2018
tanasecosminromeo added a commit to tanasecosminromeo/symfony that referenced this issue Jan 25, 2018
…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.
tanasecosminromeo added a commit to tanasecosminromeo/symfony that referenced this issue Jan 25, 2018
fabpot added a commit that referenced this issue Jan 29, 2018
…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
@fabpot fabpot closed this as completed Jan 29, 2018
vyk12 added a commit to vyk12/symfony-docs that referenced this issue Mar 28, 2018
cf. symfony/symfony#25665

This made my production system down for a couple of minutes
vyk12 added a commit to vyk12/symfony-docs that referenced this issue Mar 28, 2018
cf. symfony/symfony#25665

This made my production system down for a couple of minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants