mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
DbQuery: Support not equal comparisons with arrays
This commit is contained in:
parent
ff61b8e696
commit
1e35a17ec1
@ -288,9 +288,14 @@ class DbQuery extends SimpleQuery
|
|||||||
$expression = $this->valueToTimestamp($expression);
|
$expression = $this->valueToTimestamp($expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($expression) && $sign === '=') {
|
if (is_array($expression)) {
|
||||||
// TODO: Should we support this? Doesn't work for blub*
|
if ($sign === '=') {
|
||||||
return $col . ' IN (' . $this->escapeForSql($expression) . ')';
|
return $col . ' IN (' . $this->escapeForSql($expression) . ')';
|
||||||
|
} elseif ($sign === '!=') {
|
||||||
|
return $col . ' NOT IN (' . $this->escapeForSql($expression) . ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new QueryException('Unable to render array expressions with operators other than equal or not equal');
|
||||||
} elseif ($sign === '=' && strpos($expression, '*') !== false) {
|
} elseif ($sign === '=' && strpos($expression, '*') !== false) {
|
||||||
if ($expression === '*') {
|
if ($expression === '*') {
|
||||||
// We'll ignore such filters as it prevents index usage and because "*" means anything, anything means
|
// We'll ignore such filters as it prevents index usage and because "*" means anything, anything means
|
||||||
|
Loading…
x
Reference in New Issue
Block a user