From 49631991337cb8341935b683a48b1aba3e1ba168 Mon Sep 17 00:00:00 2001 From: arjen Date: Mon, 27 Oct 2003 11:28:27 +0000 Subject: [PATCH] Do not add another parameter_notification record is the notification already exists for that parameter. --- src/gcm_input/message.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/gcm_input/message.cpp b/src/gcm_input/message.cpp index 596aba5..1c36a27 100644 --- a/src/gcm_input/message.cpp +++ b/src/gcm_input/message.cpp @@ -8,7 +8,7 @@ *********************** ** FILE NAME : message.cpp ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring -** VERSION NUMBER : $Revision: 1.14 $ +** VERSION NUMBER : $Revision: 1.15 $ ** ** DESCRIPTION : Implementation of the message handling classes ** @@ -26,7 +26,11 @@ /***************************** $Log: message.cpp,v $ - Revision 1.14 2003-09-01 06:57:14 arjen + Revision 1.15 2003-10-27 11:28:27 arjen + Do not add another parameter_notification record is the notification + already exists for that parameter. + + Revision 1.14 2003/09/01 06:57:14 arjen Reject log entries that are found to be invalid. Revision 1.13 2003/08/16 15:28:45 arjen @@ -86,7 +90,7 @@ *****************************/ -static const char *RCSID = "$Id: message.cpp,v 1.14 2003-09-01 06:57:14 arjen Exp $"; +static const char *RCSID = "$Id: message.cpp,v 1.15 2003-10-27 11:28:27 arjen Exp $"; #include #include @@ -936,15 +940,23 @@ int client_message::enter() { remark = "Gnucomo detected a different version for package parameter(s) "; change_notification = database.new_notification(objectid, "property modified", remark); + change_notification = database.new_notification(objectid, "property modified", remark); } if (change_notification != "") { - insertion = "insert into parameter_notification (notificationid, paramid) values ('"; - insertion += change_notification + "', '"; - insertion += paramid + "')"; + qry = "select * from parameter_notification where notificationid='"; + qry += change_notification + "' and paramid='"; + qry += paramid + "'"; - database.Query(insertion); + if (database.Query(qry) == 0) + { + insertion = "insert into parameter_notification (notificationid, paramid) values ('"; + insertion += change_notification + "', '"; + insertion += paramid + "')"; + + database.Query(insertion); + } } else { -- 2.11.0