Fix #18229: Add a flag to set Connection to SyBase mode

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
This commit is contained in:
DarkDef
2020-08-18 20:48:24 +03:00
committed by GitHub
parent 8885ec55e4
commit 705be8fb85
2 changed files with 7 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ Yii Framework 2 Change Log
------------------------
- Bug #18233: Add PHP 8 support (samdark)
- Bug #18229: Add flag for recognize SyBase databases on uses pdo_dblib (darkdef)
2.0.37 August 07, 2020

View File

@@ -418,6 +418,11 @@ class Connection extends Component
* @see enableLogging
*/
public $enableProfiling = true;
/**
* @var bool If the database connected via pdo_dblib is SyBase.
* @since 2.0.38
*/
public $isSybase = false;
/**
* @var Transaction the currently active transaction
@@ -720,7 +725,7 @@ class Connection extends Component
$this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->emulatePrepare);
}
}
if (in_array($this->getDriverName(), ['mssql', 'dblib'], true)) {
if (!$this->isSybase && in_array($this->getDriverName(), ['mssql', 'dblib'], true)) {
$this->pdo->exec('SET ANSI_NULL_DFLT_ON ON');
}
if ($this->charset !== null && in_array($this->getDriverName(), ['pgsql', 'mysql', 'mysqli', 'cubrid'], true)) {