From 5ad0c67485173724d1250aeb3bdc9e64976d14a4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 28 Oct 2015 07:45:18 +0100 Subject: [PATCH] Fix: IDO tries to execute empty UPDATE queries fixes #10473 --- lib/db_ido_mysql/idomysqlconnection.cpp | 3 +++ lib/db_ido_pgsql/idopgsqlconnection.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index a189220c2..237cf6f2e 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -805,6 +805,9 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType if (type == DbQueryInsert || type == DbQueryUpdate) { std::ostringstream colbuf, valbuf; + if (type == DbQueryUpdate && query.Fields->GetLength() == 0) + return; + ObjectLock olock(query.Fields); bool first = true; diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp index 7866c1c1f..8c7a10487 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.cpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp @@ -684,6 +684,9 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType if (type == DbQueryInsert || type == DbQueryUpdate) { std::ostringstream colbuf, valbuf; + if (type == DbQueryUpdate && query.Fields->GetLength() == 0) + return; + ObjectLock olock(query.Fields); Value value;