Mysql_Tquery query size max 64 chars?
#1

Hello, when player connects i wanna show him the login dialog, and I have this query:

Код:
new query[150];
GetPlayerName(playerid, playerInfo[playerid][player_nickname], MAX_PLAYER_NAME); 
format(query, sizeof(query), "SELECT * FROM `players` WHERE `player_nickname` = '%s' LIMIT 1", playerInfo[playerid][player_nickname]);
mysql_tquery_inline(mysql, query, using inline OnAccountCheck, "");
And... the login dialog wasnt showing up (i dont have register ATM... I have the account created in database)
I used mysql_debug(True) and fount out that:

[18:53:12] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `players` WHERE `player_nickname` = 'Jonny_Barneso", callback: "FJ37DH3JG_MYSQL_INTERNAL", format: "d"

While my nickname is Jonny_Barneson. The query between the quotes is 64 characters... Is there a limit or something I dont know about? Confused af.

Edit: the callback isn't even called whoh.
Reply
#2

https://github.com/pBlueG/SA-MP-MySQ....cpp#L892-L894

No worry, query is just truncated in the log (you can disable truncating with mysql_option - https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_option )

As for not firing callback: you don't have any warnings or errors in the log?
Reply
#3

Oh, thanks. So the query is ok then.

Nope. It's clear. I figured out this happens everytime i GMX the server. If I stop mysql_server.exe and start it again, it works and I can log in until the next gmx happens.

Edit:

When I gmx, this is the log:

Код:
[19:11:49] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM players WHERE player_nickname = 'Jonny_Barneson'", callback: "FJ37DH3JG_MYSQL_INTERNAL", format: "d"
[19:11:49] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - starting query execution
[19:11:49] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - query was successfully executed within 0.341 milliseconds
[19:11:49] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[19:11:49] [DEBUG] Calling callback "FJ37DH3JG_MYSQL_INTERNAL"..
[19:11:49] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
And when I restart, this is the login log:

Код:
[19:15:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM players WHERE player_nickname = 'Jonny_Barneson'", callback: "FJ37DH3JG_MYSQL_INTERNAL", format: "d"
[19:15:21] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - starting query execution
[19:15:21] [DEBUG] CMySQLQuery::Execute[FJ37DH3JG_MYSQL_INTERNAL] - query was successfully executed within 0.451 milliseconds
[19:15:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[19:15:21] [DEBUG] Calling callback "FJ37DH3JG_MYSQL_INTERNAL"..
[19:15:21] [DEBUG] cache_get_data - connection: 1
[19:15:21] [DEBUG] cache_get_field_content - row: 0, field_name: "player_password", connection: 1, max_len: 40
[19:15:21] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "player_password", data: "12345"
[19:15:21] [DEBUG] cache_get_field_content_int - row: 0, field_name: "player_uid", connection: 1
[19:15:21] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "player_uid", data: "13"
[19:15:21] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
Reply
#4

If you don't have crashdetect install it now - this can be caused by a runtime crash. In a worse scenario, it's y_inline fault - https://github.com/Misiur/YSI-Includes/issues/62 - we can't reproduce it with small codebase, so it's a tricky to repair. Just make sure you are using latest YSI-Includes.
Reply
#5

Crashdetect doesnt show anything. I have moved the entire onAccountCheck to a different callback and using it like this.

Код:
mysql_tquery(mysql, query, "OnAccountCheck", "d", playerid);
But dialog just doesnt respond. I mean, it doesnt work at all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)