diff options
author | George Hazan <ghazan@miranda.im> | 2021-01-07 14:32:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-01-07 14:32:43 +0300 |
commit | ac0cd7a6c7210efa43cf6823e9b68f98ebf13e79 (patch) | |
tree | 2f744a6e3389f6ae52faafb6669a0602a32caa46 /plugins/Dbx_sqlite/src/dbsettings.cpp | |
parent | 2c3777fe55340d0a5326a4ebf2576c7cfabd0e74 (diff) |
Dbx_sqlite:
- fix: records from events_srt should be also removed when a contact is deleted;
- fix: last unread event should be stored in cache when new ts is larger, not smaller;
- fix: history length should be calculated using events_srt either;
- SQL syntax fixes;
- code cleaning
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbsettings.cpp')
-rwxr-xr-x | plugins/Dbx_sqlite/src/dbsettings.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Dbx_sqlite/src/dbsettings.cpp b/plugins/Dbx_sqlite/src/dbsettings.cpp index 8da14b6d9e..f3d234bb71 100755 --- a/plugins/Dbx_sqlite/src/dbsettings.cpp +++ b/plugins/Dbx_sqlite/src/dbsettings.cpp @@ -11,12 +11,12 @@ enum { }; static char *settings_stmts[SQL_SET_STMT_NUM] = { - "select distinct module from settings;", - "select type, value from settings where contact_id = ? and module = ? and setting = ? limit 1;", - "replace into settings(contact_id, module, setting, type, value) values (?, ?, ?, ?, ?);", - "delete from settings where contact_id = ? and module = ? and setting = ?;", - "select setting from settings where contact_id = ? and module = ?;", - "select changes() from settings;" + "SELECT DISTINCT module FROM settings;", + "SELECT type, value FROM settings WHERE contact_id = ? AND module = ? AND setting = ? LIMIT 1;", + "REPLACE INTO settings(contact_id, module, setting, type, value) VALUES (?, ?, ?, ?, ?);", + "DELETE FROM settings WHERE contact_id = ? AND module = ? AND setting = ?;", + "SELECT setting FROM settings WHERE contact_id = ? AND module = ?;", + "SELECT changes() FROM settings;" }; static sqlite3_stmt *settings_stmts_prep[SQL_SET_STMT_NUM] = { 0 }; |