I've a master and slave (different machines) and got the slave stopped with one duplicate entry error. If I run the query that causes the error (I can see that query via SHOW SLAVE STATUS) on the slave (when the replication is stopped) there is no error, but the slave is stopped by this query (in fact, if I try to restart the replication with START SLAVE, the error appears again). Why a right query (I can run it on the slave without error message) can stop the replication?
TABLE STRUCTURE
CREATE TABLE `table` (
`a` int(9) unsigned NOT NULL AUTO_INCREMENT,
`b` varchar(255) NOT NULL,
`c` varchar(25) DEFAULT NULL,
`d` char(40) NOT NULL,
`e` char(64) DEFAULT NULL,
`f` varchar(255) NOT NULL,
`g` varchar(100) NOT NULL,
`h` varchar(25) NOT NULL,
`i` enum('disabled','enabled') DEFAULT 'disabled',
`j` enum('disabled','enabled') DEFAULT 'disabled',
`k` enum('disabled','enabled') DEFAULT 'disabled',
`l` enum('production','sandbox') CHARACTER SET latin1 NOT NULL DEFAULT 'production',
`m` enum('active','uninstalled') NOT NULL DEFAULT 'active',
`n` datetime NOT NULL,
`o` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`p` int(11) DEFAULT NULL,
`q` char(40) DEFAULT NULL,
`r` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`s` char(40) DEFAULT NULL,
PRIMARY KEY (`a`),
UNIQUE KEY `b_d_index` (`b`,`d`),
KEY `e` (`e`),
KEY `f` (`f`),
KEY `g` (`g`),
KEY `h` (`h`),
KEY `i` (`i`),
KEY `j` (`j`),
KEY `k` (`k`),
KEY `l` (`l`),
KEY `m` (`m`),
KEY `n` (`n`),
KEY `o` (`o`),
KEY `p` (`p`),
KEY `d` (`d`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
COMPLETE ERROR
Error 'Duplicate entry 'B-D' for key 'b_d_index'' on query. Default database: 'database_name'. Query:
INSERT INTO `table`
SET `b` = 'B',`c` = 'C',`d` = 'D',`e` = 'E',`f` = 'F',`g` = 'G',`h` = 'H',`i` = 'I',`j` = 'J',`k` = 'K',`l` = 'L',`m` = 'M',`n` = NOW(),`o` = NOW(),`p` = NULL,`q` = 'Q',`r` = NOW()
ON DUPLICATE KEY UPDATE `c` = 'C',`d`= 'D',`e`='E',`f`='F',`g`='G',`h`='H',`i`='I',`j`='J',`k`='K',`l`='L',`m`='M',`o`='2012-12-19 14:06:34'
Thanks in advance.