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:
Machiavelli
2010-09-19 12:16:29 +02:00
parent a25ef43223
commit 0982719f5f
7 changed files with 151 additions and 70 deletions

View File

@@ -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)