mirror of
https://github.com/yiisoft/yii.git
synced 2026-03-05 07:44:05 +01:00
Fix #3476: Database sessions with Postgres did not work properly
close #4004
This commit is contained in:
committed by
Carsten Brandt
parent
1e1c5b7b05
commit
dadd253a20
@@ -247,7 +247,7 @@ class CDbHttpSession extends CHttpSession
|
||||
$expire=time()+$this->getTimeout();
|
||||
$db=$this->getDbConnection();
|
||||
if($db->getDriverName()=='pgsql')
|
||||
$data=new CDbExpression("convert_to(".$db->quoteValue($data).", 'UTF8')");
|
||||
$data=new CDbExpression($db->quoteValueWithType($data, PDO::PARAM_LOB)."::bytea");
|
||||
if($db->getDriverName()=='sqlsrv' || $db->getDriverName()=='mssql' || $db->getDriverName()=='dblib')
|
||||
$data=new CDbExpression('CONVERT(VARBINARY(MAX), '.$db->quoteValue($data).')');
|
||||
if($db->createCommand()->select('id')->from($this->sessionTableName)->where('id=:id',array(':id'=>$id))->queryScalar()===false)
|
||||
|
||||
Reference in New Issue
Block a user