diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-23 19:34:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-23 19:34:56 +0300 |
commit | 1d193f3a887f84ea657f39f9bb3a2e4537426a61 (patch) | |
tree | 35358955dfaa868b6ddf0b1e397f489130c21e13 /plugins/Dbx_sqlite/src/dbevents.cpp | |
parent | dbca94ca6e16a5bc270332e09ea3703bb46ceeaf (diff) |
Dbx_Sqlite: fix for an ugly bug in SQLITE3
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbevents.cpp')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index a1722dfc7c..c7e05e44a3 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -331,7 +331,7 @@ int CDbxSQLite::GetBlobSize(MEVENT hDbEvent) return -1;
mir_cslock lock(m_csDbAccess);
- sqlite3_stmt *stmt = InitQuery("SELECT LENGTH(data) FROM events WHERE id = ? LIMIT 1;", qEvBlobSize);
+ sqlite3_stmt *stmt = InitQuery("SELECT LENGTH(CAST(data AS BLOB)) AS l FROM events WHERE id = ? LIMIT 1;", qEvBlobSize);
sqlite3_bind_int(stmt, 1, hDbEvent);
int rc = sqlite3_step(stmt);
logError(rc, __FILE__, __LINE__);
@@ -361,7 +361,7 @@ BOOL CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) }
mir_cslock lock(m_csDbAccess);
- sqlite3_stmt *stmt = InitQuery("SELECT module, timestamp, type, flags, server_id, user_id, length(data), data FROM events WHERE id = ? LIMIT 1;", qEvGet);
+ sqlite3_stmt *stmt = InitQuery("SELECT module, timestamp, type, flags, server_id, user_id, LENGTH(CAST(data AS BLOB)) AS l, data FROM events WHERE id = ? LIMIT 1;", qEvGet);
sqlite3_bind_int64(stmt, 1, hDbEvent);
int rc = sqlite3_step(stmt);
logError(rc, __FILE__, __LINE__);
|