File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/Symfony/Component/HttpFoundation/Session/Storage/Handler Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,7 @@ private function doRead($sessionId)
494
494
$ selectSql = $ this ->getSelectSql ();
495
495
$ selectStmt = $ this ->pdo ->prepare ($ selectSql );
496
496
$ selectStmt ->bindParam (':id ' , $ sessionId , \PDO ::PARAM_STR );
497
+ $ insertStmt = null ;
497
498
498
499
do {
499
500
$ selectStmt ->execute ();
@@ -509,6 +510,11 @@ private function doRead($sessionId)
509
510
return is_resource ($ sessionRows [0 ][0 ]) ? stream_get_contents ($ sessionRows [0 ][0 ]) : $ sessionRows [0 ][0 ];
510
511
}
511
512
513
+ if (null !== $ insertStmt ) {
514
+ $ this ->rollback ();
515
+ throw new \RuntimeException ('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data. ' );
516
+ }
517
+
512
518
if (self ::LOCK_TRANSACTIONAL === $ this ->lockMode && 'sqlite ' !== $ this ->driver ) {
513
519
// Exclusive-reading of non-existent rows does not block, so we need to do an insert to block
514
520
// until other connections to the session are committed.
2A81
You can’t perform that action at this time.
0 commit comments