8000 storage session pdo for postgres fix by mxp100 · Pull Request #24457 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

storage session pdo for postgres fix #24457

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

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
storage session pdo for postgres fix
  • Loading branch information
mxp100 committed Oct 6, 2017
commit 2d7053e9ce460b68c02a72868effe974735cbdee
3 changes: 3 additions & 0 deletions src/Symfony/Component/HttpFoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGELOG
=========

* PdoSessionHandler changes
- bugfix timestamp integer out of range in Postgres
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be removed, we dont alter this file for bug fixes


2.6.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public function close()
$this->gcCalled = false;

// delete the session records that have expired
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol + $this->timeCol < :time";
$sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time - $this->timeCol";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't is the same?
a + b < c === a < c - b

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, in postgres
a and b - integer type (32 bit)
a+b > integer (2^32/2) - it's error
a-b <= integer and accepted by postgres

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this problem in postgres only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use unsigned types? or larger types e.g. long (64 bits instead of 32)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating tables is in the same package. But to increase the amount of data due to improper use is incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, the sessional table contains a lot of records, and the losses will be large


$stmt = $this->pdo->prepare($sql);
$stmt->bindValue(':time', time(), \PDO::PARAM_INT);
Expand Down
0