Software / code / prosody
Comparison
plugins/mod_storage_sql.lua @ 10652:0c00274528a4 0.11
mod_storage_sql: Fix check for deletion limits (fixes #1494)
The check was only performed if sql_manage_tables was set to true (the default)
It should always be performed
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 21 Feb 2020 23:00:44 +0100 |
| parent | 10012:acf4a7bfb6aa |
| child | 10653:94f6fb21a764 |
| child | 10655:ee6c12264420 |
comparison
equal
deleted
inserted
replaced
| 10646:85585910d468 | 10652:0c00274528a4 |
|---|---|
| 620 -- Check whether the table needs upgrading | 620 -- Check whether the table needs upgrading |
| 621 if upgrade_table(engine, params, false) then | 621 if upgrade_table(engine, params, false) then |
| 622 module:log("error", "Old database format detected. Please run: prosodyctl mod_%s upgrade", module.name); | 622 module:log("error", "Old database format detected. Please run: prosodyctl mod_%s upgrade", module.name); |
| 623 return false, "database upgrade needed"; | 623 return false, "database upgrade needed"; |
| 624 end | 624 end |
| 625 if engine.params.driver == "SQLite3" then | |
| 626 for row in engine:select("PRAGMA compile_options") do | |
| 627 if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then | |
| 628 engine._have_delete_limit = true; | |
| 629 end | |
| 630 end | |
| 631 end | |
| 632 end | 625 end |
| 633 end); | 626 end); |
| 627 if engine.params.driver == "SQLite3" then | |
| 628 for row in engine:select("PRAGMA compile_options") do | |
| 629 if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then | |
| 630 engine._have_delete_limit = true; | |
| 631 end | |
| 632 end | |
| 633 end | |
| 634 engines[sql.db2uri(params)] = engine; | 634 engines[sql.db2uri(params)] = engine; |
| 635 end | 635 end |
| 636 | 636 |
| 637 module:provides("storage", driver); | 637 module:provides("storage", driver); |
| 638 end | 638 end |