summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-07 14:32:43 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-07 14:32:43 +0300
commitac0cd7a6c7210efa43cf6823e9b68f98ebf13e79 (patch)
tree2f744a6e3389f6ae52faafb6669a0602a32caa46 /plugins/Dbx_sqlite/src/dbsettings.cpp
parent2c3777fe55340d0a5326a4ebf2576c7cfabd0e74 (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-xplugins/Dbx_sqlite/src/dbsettings.cpp12
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 };