mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
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
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user