IdoQuery: Use a dynamic collation when joining custom variables

refs #2508
This commit is contained in:
Johannes Meyer 2018-04-27 15:30:47 +02:00
parent c3b19996f8
commit 4ec783b75e
1 changed files with 4 additions and 2 deletions

View File

@ -106,8 +106,7 @@ abstract class IdoQuery extends DbQuery
*
* @var string
*/
private $customVarsJoinTemplate =
'%1$s = %2$s.object_id AND %2$s.varname = %3$s COLLATE latin1_general_ci';
private $customVarsJoinTemplate = '%1$s = %2$s.object_id AND %2$s.varname = %3$s';
/**
* An array with all 'virtual' tables that are already joined
@ -701,6 +700,9 @@ abstract class IdoQuery extends DbQuery
$this->initializeForOracle();
} elseif ($dbType === 'pgsql') {
$this->initializeForPostgres();
} else {
$charset = $this->ds->getConfig()->get('charset') ?: 'latin1';
$this->customVarsJoinTemplate .= " COLLATE {$charset}_general_ci";
}
$this->joinBaseTables();
$this->select->columns($this->columns);