1
0
Fork 0
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:
Paweł Chmielowski 2025-04-30 14:31:05 +02:00
parent f046aeeaa2
commit cbb88638d2

View file

@ -221,6 +221,10 @@ delete_old_messages_batch(ServerHost, TimeStamp, Type, Batch) ->
ejabberd_sql:sql_query_t(
?SQL("delete from archive where rowid in "
"(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(
?SQL("delete from archive"
@ -236,6 +240,12 @@ delete_old_messages_batch(ServerHost, TimeStamp, Type, Batch) ->
" select rowid from archive where timestamp < %(TS)d"
" and kind=%(SType)s"
" 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(
?SQL("delete from archive"