Software / code / prosody
Comparison
plugins/mod_storage_sql.lua @ 10925:73e95ecec733
mod_storage_sql: Fix incorrect results when fetching items before specific archive id
Copy/paste error, introduced in deb68066c7aa
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 12 Jun 2020 16:54:38 +0100 |
| parent | 10793:9ce67da45e54 |
| child | 10993:b5e7f4d533e2 |
comparison
equal
deleted
inserted
replaced
| 10924:0c072dd69603 | 10925:73e95ecec733 |
|---|---|
| 389 where[#where+1] = '"sort_id" > ?'; | 389 where[#where+1] = '"sort_id" > ?'; |
| 390 args[#args+1] = after_id; | 390 args[#args+1] = after_id; |
| 391 end | 391 end |
| 392 if query.before then | 392 if query.before then |
| 393 local before_id = nil; | 393 local before_id = nil; |
| 394 for row in engine:select(id_lookup_sql, query.after, args[1], args[2], args[3]) do | 394 for row in engine:select(id_lookup_sql, query.before, args[1], args[2], args[3]) do |
| 395 before_id = row[1]; | 395 before_id = row[1]; |
| 396 end | 396 end |
| 397 if not before_id then | 397 if not before_id then |
| 398 return nil, "item-not-found"; | 398 return nil, "item-not-found"; |
| 399 end | 399 end |