Module: check_mk
Branch: master
Commit: 064939e49f11502980992af314c66ee1592ef247
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=064939e49f1150…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Nov 28 14:04:25 2017 +0100
5466 FIX Fixed filtering of services table for host name
Using a filter of the form 'host_name != ...' on the services table did not
work, the result set was always empty. This has been fixed.
Change-Id: Iec63cebd731606b7598a40d150215b328443909d
---
.werks/5466 | 11 +++++++++++
livestatus/src/StringFilter.cc | 4 +---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/.werks/5466 b/.werks/5466
new file mode 100644
index 0000000..3f2ab41
--- /dev/null
+++ b/.werks/5466
@@ -0,0 +1,11 @@
+Title: Fixed filtering of services table for host name
+Level: 1
+Component: livestatus
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1511873723
+Class: fix
+
+Using a filter of the form 'host_name != ...' on the services table did not
+work, the result set was always empty. This has been fixed.
diff --git a/livestatus/src/StringFilter.cc b/livestatus/src/StringFilter.cc
index 313f451..ae211da 100644
--- a/livestatus/src/StringFilter.cc
+++ b/livestatus/src/StringFilter.cc
@@ -90,10 +90,8 @@ const std::string *StringFilter::valueForIndexing(
const std::string &column_name) const {
switch (_relOp) {
case RelationalOperator::equal:
- case RelationalOperator::not_equal:
- // TODO(sp) The cast looks very dubious, but the whole void* story
- // is quite dangerous...
return column_name == columnName() ? &_value : nullptr;
+ case RelationalOperator::not_equal:
case RelationalOperator::matches:
case RelationalOperator::doesnt_match:
case RelationalOperator::equal_icase: