aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-06-17 00:00:21 +0200
committerKim Alvefur <zash@zash.se>2023-06-17 00:00:21 +0200
commita45c06b51fbc250f738b320c96d974bf733eb5b3 (patch)
tree2ad4c1aab690715b56030369807a1a7ccf72896d
parentf70ab44b4c3f4bdf65795b85fc2f98e94feca1fb (diff)
downloadprosody-a45c06b51fbc250f738b320c96d974bf733eb5b3.tar.gz
prosody-a45c06b51fbc250f738b320c96d974bf733eb5b3.zip
mod_storage_sql: Be more specific when checking for old index in SQLite3
Prevents false positives in the odd case where something other than an index with this name might exist.
-rw-r--r--plugins/mod_storage_sql.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 3b20b3cc..3afb5d78 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -850,7 +850,7 @@ local function upgrade_table(engine, params, apply_changes) -- luacheck: ignore
local indices = {};
engine:transaction(function ()
if params.driver == "SQLite3" then
- for row in engine:select [[SELECT "name" from "sqlite_schema" WHERE "name"='prosody_index';]] do
+ for row in engine:select [[SELECT "name" FROM "sqlite_schema" WHERE "type"='index' AND "tbl_name"='prosody' AND "name"='prosody_index';]] do
indices[row[1]] = true;
end
elseif params.driver == "PostgreSQL" then