diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php index 0c7276a68..85d9169a9 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php @@ -553,6 +553,31 @@ abstract class IdoQuery extends DbQuery return stripos($mapped, 'UNIX_TIMESTAMP') !== false; } + /** + * Return whether the given alias or column name provides case insensitive value comparison + * + * @param string $aliasOrColumn + * + * @return bool + */ + public function isCaseInsensitive($aliasOrColumn) + { + if ($this->isCustomVar($aliasOrColumn)) { + return false; + } + + $column = $this->getMappedField($aliasOrColumn) ?: $aliasOrColumn; + if (! $column) { + return false; + } + + if (! empty($this->columnsWithoutCollation)) { + return in_array($column, $this->columnsWithoutCollation) || strpos($column, 'LOWER') !== 0; + } + + return preg_match('/ COLLATE .+$/', $column) === 1; + } + /** * Apply oracle specific query initialization */