From c4893ad1a09fa8c321e683610ee4cf82aca5f1a8 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 13 Apr 2014 20:22:25 +0200 Subject: [PATCH] Fix db_ido queries. Fixes #6007 --- components/db_ido_mysql/idomysqlconnection.cpp | 3 +++ components/db_ido_pgsql/idopgsqlconnection.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/components/db_ido_mysql/idomysqlconnection.cpp b/components/db_ido_mysql/idomysqlconnection.cpp index 14e1d3eae..5ee21c274 100644 --- a/components/db_ido_mysql/idomysqlconnection.cpp +++ b/components/db_ido_mysql/idomysqlconnection.cpp @@ -560,6 +560,9 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType BOOST_FOREACH(const Dictionary::Pair& kv, query.Fields) { Value value; + if (kv.second.IsEmpty()) + continue; + if (!FieldToEscapedString(kv.first, kv.second, &value)) return; diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index 3bdc29cd8..d549d8a9c 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -564,6 +564,9 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType Value value; bool first = true; BOOST_FOREACH(const Dictionary::Pair& kv, query.Fields) { + if (kv.second.IsEmpty()) + continue; + if (!FieldToEscapedString(kv.first, kv.second, &value)) return;