diff options
author | Machiavelli <none@none> | 2010-09-19 12:16:29 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2010-09-19 12:16:29 +0200 |
commit | 0982719f5fa3266adf655dc7e1541177e40c3b93 (patch) | |
tree | 813e2983afd619dd34b3e69f9b0fc0b3ed42a2b7 /src/server/shared/Database/MySQLConnection.cpp | |
parent | a25ef432233c7a9340179d3f694b2d240cdeafef (diff) |
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
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
-rw-r--r-- | src/server/shared/Database/MySQLConnection.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
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) |