[HttpFoundation] use insert or replace for sqlite session handler

This commit is contained in:
Tobias Schultze 2014-04-09 16:14:23 +02:00
parent 05ea19a4bf
commit 5c08e29b97

View File

@ -236,6 +236,8 @@ class PdoSessionHandler implements \SessionHandlerInterface
return "MERGE INTO $this->table USING (SELECT 'x' AS dummy) AS src ON ($this->idCol = :id) " .
"WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " .
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data;";
case 'sqlite':
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
}
return null;