hi trying to make a dbmail-upgrade on a snapshoted backup-machine show duplicate keys in "dbmail_envelope"
am i right that it would be the best remove this records
on the 2.2 live-server, add the unique_key and remove
this lines form 2_2-3.0.sql after that?
this records are generally strange for me :-(
_________________
mysql> ALTER TABLE dbmail_envelope ADD UNIQUE KEY physmessage_id_2
(physmessage_id);
ERROR 1062 (23000): Duplicate entry '404219' for key 'physmessage_id_2'
mysql> select * from dbmail_envelope where physmessage_id='404219' limit 3;
+----------------+--------+---------------------------------------------------------------------------------------------------+
| physmessage_id | id | envelope
|
+----------------+--------+---------------------------------------------------------------------------------------------------+
| 404219 | 407718 | ("Thu, 01 Jan 1970 00:00:00 +0000" NIL NIL NIL NIL
NIL NIL NIL NIL
"<1259405894.19903.1@(none)>") |
| 404219 | 408487 | ("Thu, 01 Jan 1970 00:00:00 +0000" NIL NIL NIL NIL
NIL NIL NIL NIL NIL)
|
| 404219 | 409588 | ("Thu, 01 Jan 1970 00:00:00 +0000" NIL NIL NIL NIL
NIL NIL NIL NIL NIL)
|
+----------------+--------+---------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)
mysql> select count(*) from dbmail_envelope where physmessage_id='404219';
+----------+
| count(*) |
+----------+
| 453 |
+----------+
1 row in set (0.00 sec)
"show create table dbmail_envelope" says:
dbmail_envelope | CREATE TABLE `dbmail_envelope` (
`physmessage_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`envelope` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `physmessage_id` (`physmessage_id`,`id`),
CONSTRAINT `dbmail_envelope_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
`dbmail_physmessage` (`id`) ON
DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2317027 DEFAULT CHARSET=utf8
ROW_FORMAT=COMPRESSED;
_________________________
mysql> delete from dbmail_envelope where physmessage_id='404219';
Query OK, 453 rows affected (0.02 sec)
mysql> ALTER TABLE dbmail_envelope ADD UNIQUE KEY physmessage_id_2
(physmessage_id);
ERROR 1062 (23000): Duplicate entry '404218' for key 'physmessage_id_2'
mysql> select count(*) from dbmail_envelope where physmessage_id='404218';
+----------+
| count(*) |
+----------+
| 453 |
+----------+
1 row in set (0.00 sec)
delete from dbmail_envelope where physmessage_id='404218';
mysql> ALTER TABLE dbmail_envelope ADD UNIQUE KEY physmessage_id_2
(physmessage_id);
Query OK, 0 rows affected (0.73 sec)
Records: 0 Duplicates: 0 Warnings: 0
signature.asc
Description: OpenPGP digital signature
_______________________________________________ DBmail mailing list [email protected] http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail
