[icinga-checkins] icinga.org: icinga-api/mhein/default: * Fixed wrong table aliases when caling methods in column notation

git at icinga.org git at icinga.org
Mon Jul 19 11:15:32 CEST 2010


Module: icinga-api
Branch: mhein/default
Commit: 253a817b35abf74a8af28ddf74aec8725f51dc9c
URL:    https://git.icinga.org/?p=icinga-api.git;a=commit;h=253a817b35abf74a8af28ddf74aec8725f51dc9c

Author: Marius Hein <marius.hein at netways.de>
Date:   Mon Jul 19 11:14:54 2010 +0200

* Fixed wrong table aliases when caling methods in column notation

---

 objects/search/IcingaApiSearchIdo.php |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/objects/search/IcingaApiSearchIdo.php b/objects/search/IcingaApiSearchIdo.php
index d90bab0..128f60e 100644
--- a/objects/search/IcingaApiSearchIdo.php
+++ b/objects/search/IcingaApiSearchIdo.php
@@ -358,6 +358,16 @@ class IcingaApiSearchIdo
 			$numFilterMatches = preg_match_all($filterPattern, $query, $filterMatches);
 		}
 
+		/*
+		 * Filter function table prefixes out of joins
+		 * @todo Find another syntax for including functions in column notation
+		 */
+		foreach ($this->joinTables as $id=>$tp) {
+			$this->joinTables[$id] = preg_replace('@^.*[^\w]+@', '', $tp);
+		}
+
+		var_dump($this->joinTables);
+
 		if ($numFilterMatches) {
 			// resolve dependencies of joins
 			foreach ($filterMatches[1] as $offset => $tables) {
@@ -369,6 +379,7 @@ class IcingaApiSearchIdo
 						}
 					}
 				}
+				
 				$filterMatches[1][$offset] = $tables[0];
 			}
 





More information about the icinga-checkins mailing list