Update of /cvsroot/perfparse/_perfparse/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7850
Modified Files:
storage_mysql.c
Log Message:
Fixed sql for database changes
Index: storage_mysql.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** storage_mysql.c 24 Aug 2006 14:22:06 -0000 1.8
--- storage_mysql.c 16 Dec 2006 00:00:49 -0000 1.9
***************
*** 446,452 ****
g_string_printf(s_SQL,
! "INSERT INTO perfdata_service (host_id, service_description, raw_delete_policy_type, service_id) VALUES ('%d'",
iHostID);
! g_string_append_printf(s_SQL, ", '%s', 'host', %d)",
sql_escape(sService,PERCENT_ESCAPE_CHAR), iTestService);
query(s_SQL->str);
--- 446,452 ----
g_string_printf(s_SQL,
! "INSERT INTO perfdata_service (host_id, service_description, service_id) VALUES ('%d'",
iHostID);
! g_string_append_printf(s_SQL, ", '%s', %d)",
sql_escape(sService,PERCENT_ESCAPE_CHAR), iTestService);
query(s_SQL->str);
***************
*** 512,520 ****
iTestMetric++;
! g_string_printf(s_SQL, "INSERT INTO perfdata_service_metric (service_id, metric, unit, bin_delete_policy_type, metric_id) VALUES ('%d'",
iServiceID);
g_string_append_printf(s_SQL, ", '%s'",
sql_escape(sMetric,PERCENT_ESCAPE_CHAR));
! g_string_append_printf(s_SQL, ", '%s', 'host', %d)",
sql_escape(sUnit,PERCENT_ESCAPE_CHAR), iTestMetric);
query(s_SQL->str);
--- 512,520 ----
iTestMetric++;
! g_string_printf(s_SQL, "INSERT INTO perfdata_service_metric (service_id, metric, unit, metric_id) VALUES ('%d'",
iServiceID);
g_string_append_printf(s_SQL, ", '%s'",
sql_escape(sMetric,PERCENT_ESCAPE_CHAR));
! g_string_append_printf(s_SQL, ", '%s', %d)",
sql_escape(sUnit,PERCENT_ESCAPE_CHAR), iTestMetric);
query(s_SQL->str);
***************
*** 542,546 ****
static int bResult;
! g_string_printf(s_SQL, "SELECT m.bin_delete_policy FROM perfdata_service_metric m, perfdata_service s, perfdata_host h WHERE h.host_id=s.host_id AND s.service_id = m.service_id and h.host_name='%s'",
sql_escape(sHost, PERCENT_ESCAPE_CHAR));
g_string_append_printf(s_SQL, " AND s.service_description = '%s'",
--- 542,546 ----
static int bResult;
! g_string_printf(s_SQL, "SELECT m.bin_delete_policy_individual, p.delete_policy_seconds FROM perfdata_service_metric m, perfdata_service s, perfdata_host h, perfdata_delete_policy p WHERE h.host_id=s.host_id AND s.service_id = m.service_id and m.bin_delete_policy_id=p.policy_id and h.host_name='%s'",
sql_escape(sHost, PERCENT_ESCAPE_CHAR));
g_string_append_printf(s_SQL, " AND s.service_description = '%s'",
***************
*** 912,917 ****
}
-
-
-
-
--- 912,913 ----
|