]> granicus.if.org Git - icinga2/commitdiff
Make sure to not ignore fields which are set to an empty string
authorGunnar Beutner <gunnar@beutner.name>
Mon, 23 Feb 2015 14:24:07 +0000 (15:24 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 23 Feb 2015 14:25:04 +0000 (15:25 +0100)
fixes #8496

lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp

index ab22952771cd0629fc5c28d5f33d205655b68c81..560f8f8a0aa0d9380c6f1cb27a1643fb5336878c 100644 (file)
@@ -673,7 +673,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
                BOOST_FOREACH(const Dictionary::Pair& kv, query.Fields) {
                        Value value;
 
-                       if (kv.second.IsEmpty())
+                       if (kv.second.IsEmpty() && !kv.second.IsString())
                                continue;
 
                        if (!FieldToEscapedString(kv.first, kv.second, &value))
index 5faf4dfd1a3fe12cdac9460f925a584b2e6a876f..e401b75cde5e219ae6f789aca54b1039a8825149 100644 (file)
@@ -668,7 +668,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
                Value value;
                bool first = true;
                BOOST_FOREACH(const Dictionary::Pair& kv, query.Fields) {
-                       if (kv.second.IsEmpty())
+                       if (kv.second.IsEmpty() && !kv.second.IsString())
                                continue;
 
                        if (!FieldToEscapedString(kv.first, kv.second, &value))