From 4c54cddec88d65f0803c10db197f83619a6c418b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 17 Aug 2016 13:24:18 +0200 Subject: [PATCH] Fix problem with duplicate INSERTs for the same key columns fixes #12461 fixes #12458 --- lib/db_ido/dbobject.cpp | 1 - lib/db_ido_mysql/idomysqlconnection.cpp | 23 +++++++++++++++-------- lib/db_ido_mysql/idomysqlconnection.hpp | 2 +- lib/db_ido_pgsql/idopgsqlconnection.cpp | 23 +++++++++++++++-------- lib/db_ido_pgsql/idopgsqlconnection.hpp | 2 +- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/lib/db_ido/dbobject.cpp b/lib/db_ido/dbobject.cpp index 555ec5ede..e00691aed 100644 --- a/lib/db_ido/dbobject.cpp +++ b/lib/db_ido/dbobject.cpp @@ -314,7 +314,6 @@ void DbObject::SendVarsStatusUpdate(void) query.WhereCriteria = new Dictionary(); query.WhereCriteria->Set("object_id", obj); query.WhereCriteria->Set("varname", kv.first); - query.Object = this; queries.push_back(query); } diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index f46bbabfe..486a816bd 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -810,7 +810,7 @@ void IdoMysqlConnection::ExecuteQuery(const DbQuery& query) { ASSERT(query.Category != DbCatInvalid); - m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, (DbQueryType *)NULL), query.Priority, true); + m_QueryQueue.Enqueue(boost::bind(&IdoMysqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true); } void IdoMysqlConnection::ExecuteMultipleQueries(const std::vector& queries) @@ -870,11 +870,11 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector& queries); void FinishExecuteQuery(const DbQuery& query, int type, bool upsert); diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp index 2a9ec50c2..51526f200 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.cpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp @@ -667,7 +667,7 @@ void IdoPgsqlConnection::ExecuteQuery(const DbQuery& query) { ASSERT(query.Category != DbCatInvalid); - m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, (DbQueryType *)NULL), query.Priority, true); + m_QueryQueue.Enqueue(boost::bind(&IdoPgsqlConnection::InternalExecuteQuery, this, query, -1), query.Priority, true); } void IdoPgsqlConnection::ExecuteMultipleQueries(const std::vector& queries) @@ -727,11 +727,11 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector& queries); void InternalCleanUpExecuteQuery(const String& table, const String& time_key, double time_value);