[02:41:14] >> mysql_connect(127.0.0.1, root, ****, ******) on port 3306 [02:41:14] CMySQLHandler::Connect() - Connection was successful. [02:41:14] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [02:41:14] >> mysql_query_callback( Connection handle: 2 ) [02:41:14] Passing query SELECT * FROM users WHERE NAME = 'Name_Name' LIMIT 0,1 | i [02:41:14] ProcessQueryThread(AnotherFunction) - Query was successful. (SELECT * FROM users WHERE NAME = 'Name_Name' LIMIT 0,1) [02:41:14] ProcessQueryThread(AnotherFunction) - Data caching enabled. [02:41:14] CMySQLHandler::StoreResult() - Result was stored. [02:41:14] CMySQLHandler::FreeResult() - Result was successfully free'd. [02:41:14] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [02:41:14] AnotherFunction(i) - Threaded function called. [02:41:14] >> cache_get_data( Connection handle: 1 ) [02:41:14] ProcessTick() - The cache has been cleared.
forward Function(playerid); public Function(playerid){ new sqlQuery[128], name[MAX_NAME_LENGHT]; GetPlayerName(playerid, name, sizeof(name)); format(sqlQuery, sizeof(sqlQuery), "SELECT * FROM users WHERE NAME = '%s' LIMIT 0,1", name); mysql_function_query(mysql, sqlQuery, true, "AnotherFunction", "i", playerid); return 1; } forward AnotherFunction(playerid); public AnotherFunction(playerid){ new rows, fields; cache_get_data(rows, fields); printf("rows: %i, fields: %i", rows, fields); return 1; }
Connection handle 2 seems odd. Especially since you're fetching a result on handle 1.
|
I'm not sure about why the connection handle is 2, but the result isn't being freed right after being stored. The code between storing and freeing is just executing in less than a millisecond, which is the smallest unit of time you can use in the pawn API.
|
Yeah, but it's frees the result before calling the AnotherFunction..
|
[07:28:08] Passing query SELECT * FROM `settings` LIMIT 1 | iii [07:28:08] ProcessQueryThread(OnServerQueryFinish) - Query was successful. (SELECT * FROM `settings` LIMIT 1) [07:28:08] ProcessQueryThread(OnServerQueryFinish) - Data caching enabled. [07:28:08] CMySQLHandler::StoreResult() - Result was stored. [07:28:08] CMySQLHandler::FreeResult() - Result was successfully free'd. [07:28:08] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick() [07:28:08] OnServerQueryFinish(iii) - Threaded function called. [07:28:08] >> cache_get_data( Connection handle: 1 ) [07:28:08] ProcessTick() - The cache has been cleared.