--- cacti-release-0.8.6/lib/data_query.php	2004-09-30 22:37:35.000000000 -0400
+++ cacti-unstable/lib/data_query.php	2004-11-02 00:28:16.000000000 -0500
@@ -28,6 +28,7 @@
 	global $config;
 
 	include_once($config["library_path"] . "/poller.php");
+	include_once($config["library_path"] . "/utility.php");
 
 	debug_log_insert("data_query", "Running data query [$snmp_query_id].");
 	$type_id = db_fetch_cell("select data_input.type_id from snmp_query,data_input where snmp_query.data_input_id=data_input.id and snmp_query.id=$snmp_query_id");
@@ -54,6 +55,9 @@
 	/* update the the "local" data query cache */
 	update_data_query_cache($host_id, $snmp_query_id);
 
+	/* update the poller cache */
+	update_poller_cache_from_query($host_id, $snmp_query_id);
+
 	return (isset($result) ? $result : true);
 }
 
--- cacti-release-0.8.6/lib/utility.php	2004-08-31 21:28:15.000000000 -0400
+++ cacti-unstable/lib/utility.php	2004-10-31 15:56:12.000000000 -0500
@@ -36,6 +36,16 @@
 	}
 }
 
+function update_poller_cache_from_query($host_id, $data_query_id) {
+	$poller_data = db_fetch_assoc("select id from data_local where host_id = '$host_id' and snmp_query_id = '$data_query_id'");
+
+	if (sizeof($poller_data) > 0) {
+		foreach ($poller_data as $data) {
+			update_poller_cache($data["id"]);
+		}
+	}
+}
+
 function update_poller_cache($local_data_id, $truncate_performed = false) {
 	global $config;
 
