-
-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Description
Help us help you
- I have checked that my issue doesn't exist yet.
- I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
- I can always reproduce the issue with the provided description below.
Environment
- Operating System version: Ubuntu server 16.04 (But I'm pretty sure it happens on every os)
- Game/AppID (with version if applicable): Counter-Strike: Global offensive (But I'm pretty sure it happens on every game that SourceMod Supports)
- Current SourceMod version: 1.8.0
- Current SourceMod snapshot: 6041
- Current Metamod: Source snapshot: 1.10.7
- I have updated SourceMod to the latest version and it still happens.
- I have updated SourceMod to the latest snapshot and it still happens.
- I have updated SourceMM to the latest snapshot and it still happens.
Description
Like I say in the title, I'm needing the support of get results from MySQL DB Stored Procedures.
I asked first on https://forums.alliedmods.net/showthread.php?p=2595241#post2595241 and asherkin told me the problem is in the driver.
The actual driver supports a single result set per query and CALL always returns multiple so does not work.
In the post, I say I would like to help. But I'm not too familiar with C ++ syntax but I have experience with Java.
If there is something I can do please tell me.
Problematic Code (or Steps to Reproduce)
Stored Procedure:
`sp_load_characters`(steam_id INT)
BEGIN
SELECT c.id, c.name, c.level, c.reset
FROM Players p RIGHT JOIN Characters c ON (p.id = c.idPlayer)
WHERE p.steamid = steam_id;
END
Code:
int steamid = GetSteamAccountID(client);
char error[255];
Database db = SQL_DefConnect(error, sizeof(error));
DBStatement hUserStmt = null;
if (db == null){
PrintToServer("Could not connect: %s", error);
}
/* Check if we haven't already created the statement */
if (hUserStmt == null){
char error2[255];
hUserStmt = SQL_PrepareQuery(db, "CALL sp_load_characters(?)", error2, sizeof(error2));
if (hUserStmt == null){
PrintToServer(error2);
delete hUserStmt;
delete db;
return Plugin_Handled;
}
}
SQL_BindParamInt(hUserStmt, 0, steamid, false);
if (!SQL_Execute(hUserStmt)){
char errorr[255];
SQL_GetError(hUserStmt, errorr, sizeof(errorr));
PrintToServer(errorr);
delete hUserStmt;
delete db;
return Plugin_Handled;
}
int rows = SQL_GetRowCount(query);
PrintToServer("%d", rows); //returns 0
delete hUserStmt;
delete db;
return Plugin_Handled;
Logs
No logs, just no resultset.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels