bug #2544: Use REPLACE to insert monitoring values

(cherry picked from commit dc79dd2c38)
This commit is contained in:
Ruben S. Montero committed 2014-01-03 00:54:41 +01:00
1 parent cde56bfb6f
commit 59e97c4ea8
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -495,7 +495,7 @@ int Host::update_monitoring(SqlDB * db)
goto error_xml;
}
oss << "INSERT INTO " << monit_table << " ("<< monit_db_names <<") VALUES ("
oss << "REPLACE INTO " << monit_table << " ("<< monit_db_names <<") VALUES ("
<< oid << ","
<< last_monitored << ","
<< "'" << sql_xml << "')";
+1 -1
View File
@@ -1346,7 +1346,7 @@ int VirtualMachine::update_monitoring(SqlDB * db)
goto error_xml;
}
oss << "INSERT INTO " << monit_table << " ("<< monit_db_names <<") VALUES ("
oss << "REPLACE INTO " << monit_table << " ("<< monit_db_names <<") VALUES ("
<< oid << ","
<< last_poll << ","
<< "'" << sql_xml << "')";