From: Stéphane Jacob Date: Tue, 1 Mar 2011 10:33:23 +0000 (+0100) Subject: Removes useless LEFT JOIN. X-Git-Tag: xorg/1.1.0~91 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7756ff03ecb06cf8df0ac2a10bc7f682af3d1a78;p=platal.git Removes useless LEFT JOIN. Signed-off-by: Stéphane Jacob --- diff --git a/upgrade/1.1.0/02_new_mail_insertion.sql b/upgrade/1.1.0/02_new_mail_insertion.sql index 411b4bd..3a3b9c4 100644 --- a/upgrade/1.1.0/02_new_mail_insertion.sql +++ b/upgrade/1.1.0/02_new_mail_insertion.sql @@ -79,11 +79,10 @@ INSERT INTO homonyms_list (hrmid, uid) -- 5/ Feeds email_redirect_account INSERT INTO email_redirect_account (uid, redirect, rewrite, type, action, broken_date, broken_level, last, flags, hash, allow_rewrite) - SELECT a.uid, e.email, e.rewrite, 'smtp', ef.email, e.panne, e.panne_level, e.last, + SELECT e.uid, e.email, e.rewrite, 'smtp', ef.email, e.panne, e.panne_level, e.last, IF(e.flags = '', 'inactive', IF(e.flags = 'disable', 'disabled', IF(e.flags = 'panne', 'broken', e.flags))), e.hash, e.allow_rewrite FROM emails AS e LEFT JOIN emails AS ef ON (e.uid = ef.uid) - LEFT JOIN accounts AS a ON (e.uid = a.uid) WHERE e.flags != 'filter' AND ef.flags = 'filter'; INSERT INTO email_redirect_account (uid, redirect, type, action, flags) SELECT a.uid, CONCAT(a.hruid, '@g.polytechnique.org'), 'googleapps', ef.email, 'active'