mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Add mssql specific implementation of delete_old_mam_messages
This commit is contained in:
parent
f046aeeaa2
commit
cbb88638d2
1 changed files with 10 additions and 0 deletions
|
@ -221,6 +221,10 @@ delete_old_messages_batch(ServerHost, TimeStamp, Type, Batch) ->
|
||||||
ejabberd_sql:sql_query_t(
|
ejabberd_sql:sql_query_t(
|
||||||
?SQL("delete from archive where rowid in "
|
?SQL("delete from archive where rowid in "
|
||||||
"(select rowid from archive where timestamp < %(TS)d and %(ServerHost)H limit %(Batch)d)"));
|
"(select rowid from archive where timestamp < %(TS)d and %(ServerHost)H limit %(Batch)d)"));
|
||||||
|
(mssql, _) ->
|
||||||
|
ejabberd_sql:sql_query_t(
|
||||||
|
?SQL("delete top(%(Batch)d)§ from archive"
|
||||||
|
" where timestamp < %(TS)d and %(ServerHost)H"));
|
||||||
(_, _) ->
|
(_, _) ->
|
||||||
ejabberd_sql:sql_query_t(
|
ejabberd_sql:sql_query_t(
|
||||||
?SQL("delete from archive"
|
?SQL("delete from archive"
|
||||||
|
@ -236,6 +240,12 @@ delete_old_messages_batch(ServerHost, TimeStamp, Type, Batch) ->
|
||||||
" select rowid from archive where timestamp < %(TS)d"
|
" select rowid from archive where timestamp < %(TS)d"
|
||||||
" and kind=%(SType)s"
|
" and kind=%(SType)s"
|
||||||
" and %(ServerHost)H limit %(Batch)d)"));
|
" and %(ServerHost)H limit %(Batch)d)"));
|
||||||
|
(mssql, _)->
|
||||||
|
ejabberd_sql:sql_query_t(
|
||||||
|
?SQL("delete top(%(Batch)d) from archive"
|
||||||
|
" where timestamp < %(TS)d"
|
||||||
|
" and kind=%(SType)s"
|
||||||
|
" and %(ServerHost)H"));
|
||||||
(_,_)->
|
(_,_)->
|
||||||
ejabberd_sql:sql_query_t(
|
ejabberd_sql:sql_query_t(
|
||||||
?SQL("delete from archive"
|
?SQL("delete from archive"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue