Skip to content

Commit 5c08e29

Browse files
committed
[HttpFoundation] use insert or replace for sqlite session handler
1 parent 05ea19a commit 5c08e29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ private function getMergeSql()
236236
return "MERGE INTO $this->table USING (SELECT 'x' AS dummy) AS src ON ($this->idCol = :id) " .
237237
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " .
238238
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data;";
239+
case 'sqlite':
240+
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
239241
}
240242

241243
return null;

0 commit comments

Comments
 (0)