I'm still Andrea Brancatelli from another address as the whole dbmail 
crashed right now.

Now I am in troubles.

After trying to fix up something yesterday the whole message base 
started to dismant so today i decided to rename the dbmail database to 
something else, and to recreate it new.

After creating it (InnoDB with all the foreign keys and such) I 
imported datas from my old database for the following tables ONLY:

dbmail_aliases
dbmail_mailboxes
dbmail_subscription
dbmail_users

My plan was to set all the autoincrement to an higher value, like 
500000 so that I could import my old messages in later, but I forgot to 
do it, so this was not an issue.

I restarted sendmail and the first messages came in. Immediately a lot 
of errors like the following one started appearing in maillog:

May 15 12:48:07 carota dbmail/smtp[72590]: Error [Cannot delete or 
update a parent row: a foreign key constraint fails (`dbmail`.
`dbmail_datefield`, CONSTRAINT `dbmail_datefield_ibfk_1` FOREIGN KEY 
(`physmessage_id`) REFERENCES `dbmail_physmessage` (`id`))] [DELETE 
FROM dbmail_physmessage WHERE id = 23]
May 15 12:48:07 carota dbmail/smtp[72590]: Error failed to delete 
temporary message [29]
May 15 12:48:07 carota dbmail/smtp[72590]: Warning 500  Permanent 
Failure (null) ^C^M

Now, I did some investigation and I've seen that DELETE FROM 
dbmail_physmessage WHERE id = 23 from mysql returns an error about 
broking a foreign key:

mysql> DELETE FROM dbmail_physmessage WHERE id = 23;
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign 
key constraint fails (`dbmail`.`dbmail_datefield`, CONSTRAINT 
`dbmail_datefield_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES 
`dbmail_physmessage` (`id`))

but...

 show create table dbmail_physmessage;

CREATE TABLE `dbmail_physmessage` (
  `id` bigint(21) NOT NULL AUTO_INCREMENT,
  `messagesize` bigint(21) NOT NULL DEFAULT '0',
  `rfcsize` bigint(21) NOT NULL DEFAULT '0',
  `internal_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

and

show create table dbmail_datefield;

 CREATE TABLE `dbmail_datefield` (
  `physmessage_id` bigint(20) NOT NULL,
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `datefield` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `physmessage_id` (`physmessage_id`,`datefield`),
  CONSTRAINT `dbmail_datefield_ibfk_1` FOREIGN KEY (`physmessage_id`) 
REFERENCES `dbmail_physmessage` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Now you can see that the fucking ON DELETE CASCADE and ON UPDATE 
CASCADE keeps going away and I DON'T KNOW WHY, there must be some bug 
within MYSQL, as the tables were created from create_table.mysql from 
the distribution dir (and it HAS the ON UPDATE and ON DELETE).

Now I'll try to reapply the foreign key manually and I'll see what 
happens...

Any interesting suggestion in the meantime?


Naviga e telefona senza limiti con Tiscali     
Scopri le promozioni Tiscali adsl: navighi e telefoni senza canone Telecom

http://abbonati.tiscali.it/adsl/

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to