Mercurial > prosody-hg
comparison plugins/mod_storage_sql.lua @ 13915:9a69918b5e63 13.0
mod_storage_sql: Assert that serialization of archive:set() payload succeeds
Potentially encountered on a production server - the assert() should prevent
more subtle failure modes, and help us pinpoint the root cause.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 22 Jul 2025 16:34:27 +0100 |
| parents | ce4b4c2863f3 |
| children | b7714c28442f 758d5d4e83ca |
comparison
equal
deleted
inserted
replaced
| 13913:2f754817bf4b | 13915:9a69918b5e63 |
|---|---|
| 554 local where = { "\"host\" = ?", "\"user\" = ?", "\"store\" = ?", "\"key\" = ?"}; | 554 local where = { "\"host\" = ?", "\"user\" = ?", "\"store\" = ?", "\"key\" = ?"}; |
| 555 | 555 |
| 556 if new_value then | 556 if new_value then |
| 557 table.insert(setf, '"type" = ?') | 557 table.insert(setf, '"type" = ?') |
| 558 table.insert(setf, '"value" = ?') | 558 table.insert(setf, '"value" = ?') |
| 559 local t, value = serialize(new_value); | 559 local t, value = assert(serialize(new_value)); |
| 560 table.insert(args, 1, t); | 560 table.insert(args, 1, t); |
| 561 table.insert(args, 2, value); | 561 table.insert(args, 2, value); |
| 562 end | 562 end |
| 563 | 563 |
| 564 if new_when then | 564 if new_when then |
