1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Remove query queueing mechanism from the MySQL connection handle.

This commit is contained in:
Sandu Liviu Catalin 2016-06-03 22:17:01 +03:00
parent 125088c9e3
commit 2f16d63e2a
2 changed files with 4 additions and 25 deletions

View File

@ -59,7 +59,6 @@ ConnHnd::Handle::Handle(const Account & acc)
, mSSL_CA_Path(acc.GetSSL_CA_Path()) , mSSL_CA_Path(acc.GetSSL_CA_Path())
, mSSL_Cipher(acc.GetSSL_Cipher()) , mSSL_Cipher(acc.GetSSL_Cipher())
, mCharset() , mCharset()
, mQueue()
, mAutoCommit(acc.GetAutoCommit()) , mAutoCommit(acc.GetAutoCommit())
, mInTransaction(false) , mInTransaction(false)
{ {
@ -116,7 +115,7 @@ ConnHnd::Handle::Handle(const Account & acc)
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
ConnHnd::Handle::~Handle() ConnHnd::Handle::~Handle()
{ {
Disconnect();
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
@ -134,13 +133,7 @@ void ConnHnd::Handle::Disconnect()
} }
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
Int32 ConnHnd::Handle::Flush(Uint32 /*num*/, Object & /*env*/, Function & /*func*/) Uint64 ConnHnd::Handle::Execute(CSStr query, Ulong size)
{
return 0;
}
// ------------------------------------------------------------------------------------------------
Ulong ConnHnd::Handle::Execute(CSStr query, Ulong size)
{ {
// Make sure that we are connected // Make sure that we are connected
if (!mPtr) if (!mPtr)
@ -163,7 +156,7 @@ Ulong ConnHnd::Handle::Execute(CSStr query, Ulong size)
THROW_CURRENT_HND((*this), "Unable to execute query"); THROW_CURRENT_HND((*this), "Unable to execute query");
} }
// Where the number of affected rows will be stored // 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 // Count the number of affected rows by any "upsert" statement
while (true) while (true)
{ {

View File

@ -4,9 +4,6 @@
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
#include "Common.hpp" #include "Common.hpp"
// ------------------------------------------------------------------------------------------------
#include <vector>
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
namespace SqMod { namespace SqMod {
@ -45,9 +42,6 @@ public:
protected: protected:
// --------------------------------------------------------------------------------------------
typedef std::vector< String > QueryList; // Container used to queue queries.
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* The structure that holds the data associated with a certain connection. * The structure that holds the data associated with a certain connection.
*/ */
@ -80,9 +74,6 @@ protected:
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
String mCharset; // Default connection character set. 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 mAutoCommit; // Whether autocommit is enabled on this connection.
bool mInTransaction; // Whether the connection is in the middle of a transaction. bool mInTransaction; // Whether the connection is in the middle of a transaction.
@ -111,15 +102,10 @@ protected:
*/ */
void Disconnect(); 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. * Execute a query on the server.
*/ */
Ulong Execute(CSStr query, Ulong size = 0UL); Uint64 Execute(CSStr query, Ulong size = 0UL);
}; };
private: private: