1 include/master-slave.inc
3 drop table if exists t1,t2;
5 a int unsigned not null auto_increment primary key,
9 a int unsigned not null auto_increment primary key,
12 INSERT INTO t1 VALUES (NULL, 0);
13 INSERT INTO t1 SELECT NULL, 0 FROM t1;
14 INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
15 SELECT * FROM t1 ORDER BY a;
19 SELECT * FROM t2 ORDER BY a;
23 UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a;
24 SELECT * FROM t1 ORDER BY a;
28 SELECT * FROM t2 ORDER BY a;
32 SELECT * FROM t1 ORDER BY a;
36 SELECT * FROM t2 ORDER BY a;
42 CREATE TABLE t1 ( a INT );
43 INSERT INTO t1 VALUES (0);
44 UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;