You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
619 B

  1. stop slave;
  2. drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
  3. reset master;
  4. reset slave;
  5. drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
  6. start slave;
  7. CREATE TABLE t1 (
  8. a int unsigned not null auto_increment primary key,
  9. b int unsigned
  10. ) ENGINE=MyISAM;
  11. CREATE TABLE t2 (
  12. a int unsigned not null auto_increment primary key,
  13. b int unsigned
  14. ) ENGINE=MyISAM;
  15. INSERT INTO t1 VALUES (NULL, 0);
  16. INSERT INTO t1 SELECT NULL, 0 FROM t1;
  17. INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
  18. SELECT * FROM t1 ORDER BY a;
  19. a b
  20. 1 0
  21. 2 0
  22. SELECT * FROM t2 ORDER BY a;
  23. a b
  24. 1 0
  25. 2 1
  26. UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
  27. drop table t1, t2;