[ postfixadmin-Bugs-2018402 ] error with deleting mailbox or alias
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2008-11-13 12:24:56
|
Bugs item #2018402, was opened at 2008-07-15 06:52 Message generated for change (Settings changed) made by christian_boltz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2018402&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Database Group: v 2.2 >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: error with deleting mailbox or alias Initial Comment: Hi. When I'm want delete a mailbox or alias I see next error: DEBUG INFORMATION: Invalid query: Duplicate entry '2008-07-15 10:22:30' for key 1 and mysql.log 58241 Query DELETE FROM alias WHERE address='te...@ex...' AND domain='example.ru' 58242 Query INSERT INTO log (timestamp,username,domain,action,data) VALUES (NOW(),'an...@ex... (17.7.181.96)','example.ru','delete_alias','te...@ex...') 58243 Query SELECT * FROM mailbox WHERE username='te...@ex...' AND domain='example.ru' 58244 Query DELETE FROM mailbox WHERE username='te...@ex...' AND domain='example.ru' 58245 Query DELETE FROM vacation WHERE email='te...@ex...' AND domain='example.ru' 58246 Query INSERT INTO log (timestamp,username,domain,action,data) VALUES (NOW(),'an...@ex... (17.7.181.96)','example.ru','delete_mailbox','te...@ex...') In my opinion problem be appear at the time of query insert data on table "log" to MySQL in a unit of time. Fixed this problem I can added in file delete.php function sleep(1); 123 $result = db_query ("DELETE FROM $table_mailbox WHERE username='$fDelete' AND domain='$fDomain'"); 124 sleep (1); 125 $postdel_res=mailbox_postdeletion($fDelete,$fDomain); 126 if ($result['rows'] != 1 || !$postdel_res) ---------------------------------------------------------------------- >Comment By: Christian Boltz (christian_boltz) Date: 2008-11-13 13:24 Message: You indeed have a PRIMARY KEY instead of a normal INDEX on the timestamp field. To fix this, run these two SQL commands: ALTER TABLE `log` DROP PRIMARY KEY; ALTER TABLE `log` ADD INDEX ( `timestamp` ); Since I still have no idea why you have a PRIMARY KEY instead of an INDEX and this is the only report I got about this, I'm closing this bug as "works for me". If you find out where the PRIMARY KEY came from, feel free to reopen ;-) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-11-13 04:27 Message: 1) I can't remember when I change log table :) 2) | log | CREATE TABLE `log` ( `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `username` varchar(255) NOT NULL default '', `domain` varchar(255) NOT NULL default '', `action` varchar(255) NOT NULL default '', `data` varchar(255) NOT NULL default '', PRIMARY KEY (`timestamp`) ) ENGINE=MyISAM DEFAULT CHARSET=koi8r COMMENT='Postfix Admin - Log' | ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2008-11-12 23:22 Message: This looks like your "log" table an UNIQUE key on the timestamp field instead of a INDEX. But: I have no _why_ this could happen. Questions: - did you manually modify the log table? - what's the output of SHOW CREATE TABLE log; ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=2018402&group_id=191583 |