mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Merge pull request #3443 from Icinga/fix/search-over-customvars-results-in-sql-error-2508
Fix search over customvars results in sql error 2508
This commit is contained in:
commit
60295f3407
@ -98,6 +98,16 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
|
|||||||
return $query->getSelectQuery()->query();
|
return $query->getSelectQuery()->query();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the connection configuration
|
||||||
|
*
|
||||||
|
* @return ConfigObject
|
||||||
|
*/
|
||||||
|
public function getConfig()
|
||||||
|
{
|
||||||
|
return $this->config;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for database type
|
* Getter for database type
|
||||||
*
|
*
|
||||||
|
@ -106,8 +106,7 @@ abstract class IdoQuery extends DbQuery
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $customVarsJoinTemplate =
|
private $customVarsJoinTemplate = '%1$s = %2$s.object_id AND %2$s.varname = %3$s';
|
||||||
'%1$s = %2$s.object_id AND %2$s.varname = %3$s COLLATE latin1_general_ci';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array with all 'virtual' tables that are already joined
|
* An array with all 'virtual' tables that are already joined
|
||||||
@ -701,6 +700,9 @@ abstract class IdoQuery extends DbQuery
|
|||||||
$this->initializeForOracle();
|
$this->initializeForOracle();
|
||||||
} elseif ($dbType === 'pgsql') {
|
} elseif ($dbType === 'pgsql') {
|
||||||
$this->initializeForPostgres();
|
$this->initializeForPostgres();
|
||||||
|
} else {
|
||||||
|
$charset = $this->ds->getConfig()->get('charset') ?: 'latin1';
|
||||||
|
$this->customVarsJoinTemplate .= " COLLATE {$charset}_general_ci";
|
||||||
}
|
}
|
||||||
$this->joinBaseTables();
|
$this->joinBaseTables();
|
||||||
$this->select->columns($this->columns);
|
$this->select->columns($this->columns);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user