From 6ec360b0b7e3f05b780659961c994af32b0cf715 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 23 Oct 2014 18:26:54 +0000 Subject: [PATCH] AliasHandler: - finally fix alias deletion when using MariaDB. The workaround is to add another field from the subquery to the outer SELECT so that MariaDB can't optimize the subquery to "always 1" http://sourceforge.net/p/postfixadmin/bugs/325/ (I'll open a MariaDB bugreport and add the link to the bugtracker) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1703 a1433add-5e2c-0410-b055-b7f2511e0802 --- CHANGELOG.TXT | 4 ++-- model/AliasHandler.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index ea8e43cd..05b8b541 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -15,8 +15,8 @@ SVN changes since 3.0 beta1 (2.91) - AliasHandler: don't clean goto field when making alias inactive (bug#316) - list-virtual: display quota even if $CONF[used_quotas] == NO (bug#307) - vacation.pl: fix postgresql queries in vacation.pl (bug#315) -- fix query in AliasHandler getList() which caused an empty list in MariaDB - (bug#313, bug#325) +- fix query in AliasHandler getList() which caused an empty list and breaks + deletion of aliases in MariaDB (bug#313, bug#325) - fetchmail.pl: fix ssl extra options (cert check, cert path, fingerprint) - fix logging (run setup.php to fix old log entries) (bug#317) - fetchmail.php: change error_reporting() to exclude E_NOTICE (bug#322) diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 7a293339..ab96b78a 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -39,7 +39,8 @@ class AliasHandler extends PFAHandler { /*options*/ '', /*not_in_db*/ 0, /*dont_write_to_db*/ 1, - /*select*/ 'coalesce(__is_mailbox,0) as is_mailbox', + /*select*/ 'coalesce(__is_mailbox,0) as is_mailbox, __mailbox_username', + # __mailbox_username is unused, but needed as workaround for a MariaDB bug /*extrafrom*/ 'LEFT JOIN ( ' . ' SELECT 1 as __is_mailbox, username as __mailbox_username ' . ' FROM ' . table_by_key('mailbox') .