Bug #136 | INSERT SELECT does not write the same num of rows on master and slave | ||
---|---|---|---|
Submitted: | 9 Mar 2003 15:55 | Modified: | 11 Mar 2003 16:26 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 4.0 | OS: | Linux (Linux at least) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
[9 Mar 2003 15:55]
Guilhem Bichot
[10 Mar 2003 8:20]
Guilhem Bichot
Replication is broken the same way : MASTER> reset master ; drop table t,u; Query OK, 0 rows affected (0.04 sec) Query OK, 0 rows affected (0.10 sec) MASTER> CREATE TABLE `t` ( -> `a` int(11) NOT NULL auto_increment, -> `b` int(11) default NULL, -> PRIMARY KEY (`a`) -> ) TYPE=MyISAM; Query OK, 0 rows affected (0.08 sec) MASTER> CREATE TABLE `u` ( -> `a` int(11) NOT NULL auto_increment, -> `b` int(11) default NULL, -> PRIMARY KEY (`a`) -> ) TYPE=MyISAM; Query OK, 0 rows affected (0.00 sec) MASTER> select count(*) from t; select count(*) from u; +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec) +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) #launch the Perl DBI program and while it runs do MASTER> insert into u select * from t; Query OK, 922 rows affected (0.07 sec) Records: 922 Duplicates: 0 Warnings: 0 #wait for the Perl program to finish and do MASTER> select count(*) from t; select count(*) from u; +----------+ | count(*) | +----------+ | 30000 | +----------+ 1 row in set (0.00 sec) +----------+ | count(*) | +----------+ | 922 | +----------+ 1 row in set (0.00 sec) Then on the slave : SLAVE> select count(*) from t; select count(*) from u; +----------+ | count(*) | +----------+ | 30000 | +----------+ 1 row in set (0.00 sec) +----------+ | count(*) | +----------+ | 926 | +----------+ 1 row in set (0.00 sec) I will take care of this bug. This way, if it's bogus, nobody but me will lose time :)
[11 Mar 2003 5:58]
Guilhem Bichot
I'll work on this today. But I don't know yet if it will be quickly fixable. It's quite serious ; I can repeat it easily.
[11 Mar 2003 15:50]
Guilhem Bichot
It works even for such simple table structures : create table t(a int);create table u(a int); but then the problem occurs more rarely (one every fifth try). Whereas with this create table t(a int, b timestamp, key(a,b)); create table u(a int, b timestamp, key(a,b)); it's one every other try at least. One has to wait several seconds (5 on my machine, which means around 10000 inserted lines) to make it happen. I'm now sending a patch for review to Serg and dev-public.
[11 Mar 2003 16:26]
Guilhem Bichot
Thank you for your bug report. This issue has been fixed in the latest development tree for that product. You can find more information about accessing our development trees at http://www.mysql.com/doc/en/Installing_source_tree.html