1
0

better DB inserting of the query to not move around the char array later

This commit is contained in:
Emagi 2025-07-30 08:44:01 -04:00
parent 74fa672e65
commit 8f47a27b1d
2 changed files with 3 additions and 3 deletions

View File

@ -271,7 +271,7 @@ void Query::AddQueryAsync(int32 queryID, Database* db, QUERY_TYPE type, const ch
va_end(args);
query = string(buffer);
Query* asyncQuery = new Query(this, queryID);
Query* asyncQuery = new Query(this, queryID, query);
safe_delete_array(buffer);

View File

@ -109,7 +109,7 @@ public:
memset(errbuf, 0, sizeof(errbuf));
queryID = 0;
}
Query(Query* queryPtr, int32 in_id) {
Query(Query* queryPtr, int32 in_id, std::string in_query) {
result = 0;
affected_rows = 0;
last_insert_id = 0;
@ -121,7 +121,7 @@ public:
escaped_data1 = 0;
multiple_results = 0;
memset(errbuf, 0, sizeof(errbuf));
query = string(queryPtr->GetQuery());
query = std::move(in_query);
in_type = queryPtr->GetQueryType();
queryID = in_id;
}