From 0982719f5fa3266adf655dc7e1541177e40c3b93 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 19 Sep 2010 12:16:29 +0200 Subject: Core/DBLayer: - Declare the datatypes used to determine transaction element data (prepared statement/adhoc query string) on a generic level in SQLOperation.h - Implement variable SQL element data for SQLQueryHolder class so it can execute both prepared statements and adhoc queries - Make MySQLConnection::Query for adhoc queries return pointer to type instead of an autopointer, the autopointer is now applied on higher level code just like the function for querying prepared statements --HG-- branch : trunk --- src/server/shared/Database/MySQLConnection.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/server/shared/Database/MySQLConnection.cpp') diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index e8f5bb08699..ef78d0afdb0 100644 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -233,10 +233,10 @@ bool MySQLConnection::Execute(PreparedStatement* stmt) } } -QueryResult MySQLConnection::Query(const char* sql) +ResultSet* MySQLConnection::Query(const char* sql) { if (!sql) - return QueryResult(NULL); + return NULL; MYSQL_RES *result = NULL; MYSQL_FIELD *fields = NULL; @@ -244,13 +244,9 @@ QueryResult MySQLConnection::Query(const char* sql) uint32 fieldCount = 0; if (!_Query(sql, &result, &fields, &rowCount, &fieldCount)) - return QueryResult(NULL); + return NULL; - ResultSet *queryResult = new ResultSet(result, fields, rowCount, fieldCount); - - queryResult->NextRow(); - - return QueryResult(queryResult); + return new ResultSet(result, fields, rowCount, fieldCount); } bool MySQLConnection::_Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **pFields, uint64* pRowCount, uint32* pFieldCount) -- cgit v1.2.3