From 2f16d63e2a4ab8a33a66d85266b029521c969159 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Fri, 3 Jun 2016 22:17:01 +0300 Subject: [PATCH] Remove query queueing mechanism from the MySQL connection handle. --- modules/mysql/Handle/Connection.cpp | 13 +++---------- modules/mysql/Handle/Connection.hpp | 16 +--------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/modules/mysql/Handle/Connection.cpp b/modules/mysql/Handle/Connection.cpp index 7e401d4d..3fad77d9 100644 --- a/modules/mysql/Handle/Connection.cpp +++ b/modules/mysql/Handle/Connection.cpp @@ -59,7 +59,6 @@ ConnHnd::Handle::Handle(const Account & acc) , mSSL_CA_Path(acc.GetSSL_CA_Path()) , mSSL_Cipher(acc.GetSSL_Cipher()) , mCharset() - , mQueue() , mAutoCommit(acc.GetAutoCommit()) , mInTransaction(false) { @@ -116,7 +115,7 @@ ConnHnd::Handle::Handle(const Account & acc) // ------------------------------------------------------------------------------------------------ ConnHnd::Handle::~Handle() { - + Disconnect(); } // ------------------------------------------------------------------------------------------------ @@ -134,13 +133,7 @@ void ConnHnd::Handle::Disconnect() } // ------------------------------------------------------------------------------------------------ -Int32 ConnHnd::Handle::Flush(Uint32 /*num*/, Object & /*env*/, Function & /*func*/) -{ - return 0; -} - -// ------------------------------------------------------------------------------------------------ -Ulong ConnHnd::Handle::Execute(CSStr query, Ulong size) +Uint64 ConnHnd::Handle::Execute(CSStr query, Ulong size) { // Make sure that we are connected if (!mPtr) @@ -163,7 +156,7 @@ Ulong ConnHnd::Handle::Execute(CSStr query, Ulong size) THROW_CURRENT_HND((*this), "Unable to execute query"); } // Where the number of affected rows will be stored - Ulong affected = 0UL; + Uint64 affected = 0UL; // Count the number of affected rows by any "upsert" statement while (true) { diff --git a/modules/mysql/Handle/Connection.hpp b/modules/mysql/Handle/Connection.hpp index fa752019..a39b1022 100644 --- a/modules/mysql/Handle/Connection.hpp +++ b/modules/mysql/Handle/Connection.hpp @@ -4,9 +4,6 @@ // ------------------------------------------------------------------------------------------------ #include "Common.hpp" -// ------------------------------------------------------------------------------------------------ -#include - // ------------------------------------------------------------------------------------------------ namespace SqMod { @@ -45,9 +42,6 @@ public: protected: - // -------------------------------------------------------------------------------------------- - typedef std::vector< String > QueryList; // Container used to queue queries. - /* -------------------------------------------------------------------------------------------- * The structure that holds the data associated with a certain connection. */ @@ -80,9 +74,6 @@ protected: // ---------------------------------------------------------------------------------------- String mCharset; // Default connection character set. - // ---------------------------------------------------------------------------------------- - QueryList mQueue; // A queue of queries to be executed in groups. - // ---------------------------------------------------------------------------------------- bool mAutoCommit; // Whether autocommit is enabled on this connection. bool mInTransaction; // Whether the connection is in the middle of a transaction. @@ -111,15 +102,10 @@ protected: */ void Disconnect(); - /* ---------------------------------------------------------------------------------------- - * Execute a specific amount of queries from the queue. - */ - Int32 Flush(Uint32 num, Object & env, Function & func); - /* ---------------------------------------------------------------------------------------- * Execute a query on the server. */ - Ulong Execute(CSStr query, Ulong size = 0UL); + Uint64 Execute(CSStr query, Ulong size = 0UL); }; private: