diff options
Diffstat (limited to 'mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence')
-rw-r--r-- | mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence b/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence deleted file mode 100644 index 369f0030132b..000000000000 --- a/mail/dbmail/files/patch-0003-Fix-IMAP-mailbox-maintanence +++ /dev/null @@ -1,81 +0,0 @@ -From f2d27f8727ae4159d356d63c1af6ac1a60b1261a Mon Sep 17 00:00:00 2001 -From: Pavlo Lavrenenko <Pavlo.Lavrenenko@portaone.com> -Date: Thu, 21 May 2015 11:42:56 +0300 -Subject: [PATCH 03/33] Fix IMAP mailbox maintanence - -Update message's mailbox id in a separate explicit transaction to prevent -SQLException: ORA-01453 error on the next db_begin_transaction() call -(see db_mailbox_seq_update() next to 'UPDATE dbmail_messages SET mailbox_idnr' -query). ---- - src/dm_db.c | 6 ++++++ - src/dm_db.h | 1 + - src/maintenance.c | 8 ++------ - 3 files changed, 9 insertions(+), 6 deletions(-) - -diff --git src/dm_db.c src/dm_db.c -index feb0b34..313b33f 100644 ---- src/dm_db.c -+++ src/dm_db.c -@@ -4290,6 +4290,12 @@ void db_message_set_seq(uint64_t message_id, uint64_t seq) - END_TRY; - } - -+int db_move_message(uint64_t message_id, uint64_t mailbox_id) -+{ -+ return db_update("UPDATE %smessages SET mailbox_idnr = %" PRIu64 " WHERE message_idnr = %" PRIu64 "", -+ DBPFX, mailbox_id, message_id); -+} -+ - int db_rehash_store(void) - { - GList *ids = NULL; -diff --git src/dm_db.h src/dm_db.h -index 57aa256..84595d2 100644 ---- src/dm_db.h -+++ src/dm_db.h -@@ -777,6 +777,7 @@ char * db_returning(const char *s); - - uint64_t db_mailbox_seq_update(uint64_t mailbox_id, uint64_t message_id); - void db_message_set_seq(uint64_t message_id, uint64_t seq); -+int db_move_message(uint64_t message_id, uint64_t mailbox_id); - - int db_rehash_store(void); - -diff --git src/maintenance.c src/maintenance.c -index b4a020b..24b818c 100644 ---- src/maintenance.c -+++ src/maintenance.c -@@ -1184,7 +1184,7 @@ int do_erase_old(int days, char * mbtrash_name) - /* Move message to Trash if the message is in INBOX mailbox and date less then passed date. */ - int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - { -- Connection_T c; ResultSet_T r; ResultSet_T r1; PreparedStatement_T s; PreparedStatement_T s1; PreparedStatement_T s2; -+ Connection_T c; ResultSet_T r; ResultSet_T r1; PreparedStatement_T s; PreparedStatement_T s1; - int skip = 1; - char expire [DEF_FRAGSIZE]; - uint64_t mailbox_to; -@@ -1200,9 +1200,7 @@ int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - "WHERE mb.name = ? AND msg.status < %d " - "AND phys.internal_date < %s", - DBPFX, DBPFX, DBPFX, MESSAGE_STATUS_DELETE, expire); -- - s1 = db_stmt_prepare(c, "SELECT mailbox_idnr FROM %smailboxes WHERE owner_idnr = ? AND name = ?", DBPFX); -- s2 = db_stmt_prepare(c, "UPDATE %smessages SET mailbox_idnr = ? WHERE message_idnr = ?", DBPFX); - - db_stmt_set_str(s, 1, mbinbox_name); - -@@ -1225,9 +1223,7 @@ int do_move_old (int days, char * mbinbox_name, char * mbtrash_name) - } - - if (!skip) { -- db_stmt_set_u64(s2,1,mailbox_to); -- db_stmt_set_u64(s2,2,id); -- db_stmt_exec(s2); -+ db_move_message(id, mailbox_to); - db_mailbox_seq_update(mailbox_to, 0); - db_mailbox_seq_update(mailbox_from, 0); - } --- -2.10.1 (Apple Git-78) - |