aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar aldot <aldot@5e8054f6-fb45-0410-9d17-f830fe724320>2009-04-21 07:38:10 +0000
committerGravatar aldot <aldot@5e8054f6-fb45-0410-9d17-f830fe724320>2009-04-21 07:38:10 +0000
commitab510c8959678f284fd31eb33f7abee7a843c74e (patch)
tree6860f4f93d3469018259fad96f892408dbf8a0f7
parent8c133744fa42b466618c5803632b22ebee377ea5 (diff)
downloadndoutils-oracle-ab510c8959678f284fd31eb33f7abee7a843c74e.tar.gz
ndoutils-oracle-ab510c8959678f284fd31eb33f7abee7a843c74e.tar.bz2
- remove dead code
git-svn-id: https://www.nagiosforge.org/svn/ndoutils_oracle/trunk/ndoutils-1.4b7-oracle@84 5e8054f6-fb45-0410-9d17-f830fe724320
-rw-r--r--src/db.c2
-rw-r--r--src/dbhandlers.c146
2 files changed, 1 insertions, 147 deletions
diff --git a/src/db.c b/src/db.c
index 623b540..a18aefb 100644
--- a/src/db.c
+++ b/src/db.c
@@ -565,7 +565,7 @@ char *ndo2db_db_timet_to_sql(ndo2db_idi *idi, time_t t){
break;
case NDO2DB_DBSERVER_ORACLE:
#ifdef USE_ORACLE
- /* unixts2date is a PL/SQL function (defined in db/oracle.sql */
+ /* unixts2date is a PL/SQL function (defined in db/oracle.sql */
asprintf(&buf,"(SELECT unixts2date(%lu) FROM dual)",(unsigned long)t);
#endif
break;
diff --git a/src/dbhandlers.c b/src/dbhandlers.c
index a82cdc7..5456018 100644
--- a/src/dbhandlers.c
+++ b/src/dbhandlers.c
@@ -1883,76 +1883,6 @@ int ndo2db_handle_servicecheckdata(ndo2db_idi *idi){
result=ndo2db_db_query(idi,buf);
free(buf);
#else
- /* Unique constraint, upon match with these columns an UPDATE takes place, an INSERT otherwise */
- /*
- if(asprintf(&buf1, "instance_id='%lu' AND service_object_id='%lu' AND start_time=%s AND start_time_usec='%lu'"
- ,idi->dbinfo.instance_id
- ,object_id
- ,ts[0]
- ,start_time.tv_usec
- )==-1)
- buf1=NULL;
- */
-
- /* Values to set when updating */
- /*
- if(asprintf(&buf2, "check_type='%d', current_check_attempt='%d', max_check_attempts='%d', state='%d', state_type='%d', end_time=%s, end_time_usec='%lu', timeout='%d', early_timeout='%d', execution_time='%lf', latency='%lf', return_code='%d', output='%s', perfdata='%s'"
- ,check_type
- ,current_check_attempt
- ,max_check_attempts
- ,state
- ,state_type
- ,ts[1]
- ,end_time.tv_usec
- ,timeout
- ,early_timeout
- ,execution_time
- ,latency
- ,return_code
- ,es[2]
- ,es[3]
- )==-1)
- buf2=NULL;
- */
- /* the data part of the INSERT statement */
- /*
- if(asprintf(&buf3,"(command_object_id, command_args, command_line, instance_id, service_object_id, check_type, current_check_attempt, max_check_attempts, state, state_type, start_time, start_time_usec, end_time, end_time_usec, timeout, early_timeout, execution_time, latency, return_code, output, perfdata) VALUES ('%lu', '%s', '%s', '%lu', '%lu', '%d', '%d', '%d', '%d', '%d', %s, '%lu', %s, '%lu', '%d', '%d', '%lf', '%lf', '%d', '%s', '%s')"
- ,command_id
- ,es[0]
- ,es[1]
- ,idi->dbinfo.instance_id
- ,object_id
- ,check_type
- ,current_check_attempt
- ,max_check_attempts
- ,state
- ,state_type
- ,ts[0]
- ,start_time.tv_usec
- ,ts[1]
- ,end_time.tv_usec
- ,timeout
- ,early_timeout
- ,execution_time
- ,latency
- ,return_code
- ,es[2]
- ,es[3]
- )==-1)
- buf3=NULL;
-
- if(asprintf(&buf,"MERGE INTO %s USING DUAL ON (%s) WHEN MATCHED THEN UPDATE SET %s WHEN NOT MATCHED THEN INSERT %s"
- ,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICECHECKS]
- ,buf1
- ,buf2
- ,buf3
- )==-1)
- buf=NULL;
- free(buf1);
- free(buf2);
- free(buf3);
- */
-
void *data[21];
data[0] = (void *) &command_id;
data[1] = (void *) &es[0];
@@ -7630,43 +7560,6 @@ int ndo2db_handle_contactdefinition(ndo2db_idi *idi){
result=ndo2db_db_query(idi,buf);
free(buf);
#else
-# if 0
- /* Unique constraint, upon match with these columns an UPDATE takes place, an INSERT otherwise */
- if(asprintf(&buf1, "contact_id='%lu' AND notification_type='%d' AND command_object_id='%lu' AND command_args='%s'"
- ,contact_id
- ,HOST_NOTIFICATION
- ,command_id
- ,(es[0]==NULL)?"":es[0]
- )==-1)
- buf1=NULL;
-
- /* Values to set when updating */
- if(asprintf(&buf2, "instance_id='%lu'"
- ,idi->dbinfo.instance_id
- )==-1)
- buf2=NULL;
-
- /* the data part of the INSERT statement */
- if(asprintf(&buf3,"(instance_id, contact_id, notification_type, command_object_id, command_args) VALUES ('%lu', '%lu', '%d', '%lu', '%s')"
- ,idi->dbinfo.instance_id
- ,contact_id
- ,HOST_NOTIFICATION
- ,command_id
- ,(es[0]==NULL)?"":es[0]
- )==-1)
- buf3=NULL;
-
- if(asprintf(&buf,"MERGE INTO %s USING DUAL ON (%s) WHEN MATCHED THEN UPDATE SET %s WHEN NOT MATCHED THEN INSERT %s"
- ,ndo2db_db_tablenames[NDO2DB_DBTABLE_CONTACTNOTIFICATIONCOMMANDS]
- ,buf1
- ,buf2
- ,buf3
- )==-1)
- buf=NULL;
- free(buf1);
- free(buf2);
- free(buf3);
-# else
void *data[5];
int notification_type = HOST_NOTIFICATION;
data[0] = (void *) &idi->dbinfo.instance_id;
@@ -7677,7 +7570,6 @@ int ndo2db_handle_contactdefinition(ndo2db_idi *idi){
result = ndo2db_db_query2(idi, LIBOCI_MERGE_CONTACT_NOTIFICATION_COMMANDS, data);
if (result)
return NDO_ERROR;
-# endif
#endif
free(es[0]);
}
@@ -7720,43 +7612,6 @@ int ndo2db_handle_contactdefinition(ndo2db_idi *idi){
result=ndo2db_db_query(idi,buf);
free(buf);
#else
-# if 0
- /* Unique constraint, upon match with these columns an UPDATE takes place, an INSERT otherwise */
- if(asprintf(&buf1, "contact_id='%lu' AND notification_type='%d' AND command_object_id='%lu' AND command_args='%s'"
- ,contact_id
- ,SERVICE_NOTIFICATION
- ,command_id
- ,(es[0]==NULL)?"":es[0]
- )==-1)
- buf1=NULL;
-
- /* Values to set when updating */
- if(asprintf(&buf2, "instance_id='%lu'"
- ,idi->dbinfo.instance_id
- )==-1)
- buf2=NULL;
-
- /* the data part of the INSERT statement */
- if(asprintf(&buf3,"(instance_id, contact_id, notification_type, command_object_id, command_args) VALUES ('%lu', '%lu', '%d', '%lu', '%s')"
- ,idi->dbinfo.instance_id
- ,contact_id
- ,SERVICE_NOTIFICATION
- ,command_id
- ,(es[0]==NULL)?"":es[0]
- )==-1)
- buf3=NULL;
-
- if(asprintf(&buf,"MERGE INTO %s USING DUAL ON (%s) WHEN MATCHED THEN UPDATE SET %s WHEN NOT MATCHED THEN INSERT %s"
- ,ndo2db_db_tablenames[NDO2DB_DBTABLE_CONTACTNOTIFICATIONCOMMANDS]
- ,buf1
- ,buf2
- ,buf3
- )==-1)
- buf=NULL;
- free(buf1);
- free(buf2);
- free(buf3);
-# else
void *data[5];
int notification_type = SERVICE_NOTIFICATION;
data[0] = (void *) &idi->dbinfo.instance_id;
@@ -7767,7 +7622,6 @@ int ndo2db_handle_contactdefinition(ndo2db_idi *idi){
result = ndo2db_db_query2(idi, LIBOCI_MERGE_CONTACT_NOTIFICATION_COMMANDS, data);
if (result)
return NDO_ERROR;
-# endif
#endif
free(es[0]);
}