You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Game/AppID (with version if applicable):
Current SourceMod version:
Current SourceMod snapshot:
Current Metamod: Source snapshot:
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
Consider the following:
A table contains a longtext field.
A query retrieves a single row, including that field.
SQL_FetchString is used to read the field into a buffer of a length smaller than the longtext maximum length, but larger than the actual data due to be retrieved
This will result in an error
It appears that the code incorrectly bails upon determining that the buffer wouldn't be able to hold the maximum possible size of the longtext field - though that is irrelevant as it actually could hold the data in the scenario in question.
Problematic Code (or Steps to Reproduce)
Database db;
// ... code to connect to database
DBStatement stmt = SQL_PrepareQuery(db, "<sql here to select * from table with longtext field limit 1>", error, errorSize);
SQL_Execute(stmt);
SQL_FetchRow(stmt)
char buf[length larger than the actual data in the field];
SQL_FetchString(stmt, <field index>, buf, sizeof(buf));
Error: Exception reported: Could not fetch data in field <field index> as a string
Logs
Please attach in separate files: game output, library logs, kernel logs, and any other supporting information.
In case of a crash, please attach minidump or dump analyze output.
The text was updated successfully, but these errors were encountered:
Help us help you
Environment
Description
Consider the following:
longtext
field.SQL_FetchString
is used to read the field into a buffer of a length smaller than the longtext maximum length, but larger than the actual data due to be retrievedIt appears that the code incorrectly bails upon determining that the buffer wouldn't be able to hold the maximum possible size of the longtext field - though that is irrelevant as it actually could hold the data in the scenario in question.
Problematic Code (or Steps to Reproduce)
Error:
Exception reported: Could not fetch data in field <field index> as a string
Logs
The text was updated successfully, but these errors were encountered: