]> granicus.if.org Git - icinga2/commitdiff
IDO/MySQL: avoid empty queries 6530/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 8 Aug 2018 10:11:37 +0000 (12:11 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 8 Aug 2018 10:11:37 +0000 (12:11 +0200)
lib/db_ido_mysql/idomysqlconnection.cpp

index 9c8fd7b41b67a4a0fa2d4e4fc031c1d65bd6473c..051206231626ac146b2094ad67eaeb745b65c096 100644 (file)
@@ -519,11 +519,12 @@ void IdoMysqlConnection::FinishAsyncQueries()
 
                        size_t size_query = aq.Query.GetLength() + 1;
 
-                       if (num_bytes + size_query > m_MaxPacketSize - 512)
-                               break;
+                       if (count > 0) {
+                               if (num_bytes + size_query > m_MaxPacketSize - 512)
+                                       break;
 
-                       if (count > 0)
                                querybuf << ";";
+                       }
 
                        IncreaseQueryCount();
                        count++;