Current Path : /home/usr.opt/mysql57/mysql-test/suite/rpl/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/rpl/r/rpl_row_sp005.result |
include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t3; CREATE TABLE IF NOT EXISTS test.t1(id INT, data CHAR(16),PRIMARY KEY(id)); CREATE TABLE IF NOT EXISTS test.t2(id2 INT,PRIMARY KEY(id2)); CREATE TABLE IF NOT EXISTS test.t3(id3 INT,PRIMARY KEY(id3), c CHAR(16)); CREATE PROCEDURE test.p1() BEGIN DECLARE done INT DEFAULT 0; DECLARE spa CHAR(16); DECLARE spb,spc INT; DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1 ORDER BY id; DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2 ORDER BY id2; DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1; OPEN cur1; OPEN cur2; REPEAT FETCH cur1 INTO spb, spa; FETCH cur2 INTO spc; IF NOT done THEN IF spb < spc THEN INSERT INTO test.t3 VALUES (spb,spa); ELSE INSERT INTO test.t3 VALUES (spc,spa); END IF; END IF; UNTIL done END REPEAT; CLOSE cur1; CLOSE cur2; END| CREATE PROCEDURE test.p2() BEGIN INSERT INTO test.t1 VALUES (4,'MySQL'),(20,'ROCKS'),(11,'Texas'),(10,'kyle'); INSERT INTO test.t2 VALUES (4),(2),(1),(3); UPDATE test.t1 SET id=id+4 WHERE id=4; END| < ---- Master selects-- > ------------------------- CALL test.p2(); SELECT * FROM test.t1 ORDER BY id; id data 8 MySQL 10 kyle 11 Texas 20 ROCKS SELECT * FROM test.t2 ORDER BY id2; id2 1 2 3 4 < ---- Slave selects-- > ------------------------ include/sync_slave_sql_with_master.inc SELECT * FROM test.t1 ORDER BY id; id data 8 MySQL 10 kyle 11 Texas 20 ROCKS SELECT * FROM test.t2 ORDER BY id2; id2 1 2 3 4 < ---- Master selects-- > ------------------------- CALL test.p1(); SELECT * FROM test.t3 ORDER BY id3; id3 c 1 MySQL 2 kyle 3 Texas 4 ROCKS < ---- Slave selects-- > ------------------------ include/sync_slave_sql_with_master.inc SELECT * FROM test.t3 ORDER BY id3; id3 c 1 MySQL 2 kyle 3 Texas 4 ROCKS ALTER PROCEDURE test.p1 MODIFIES SQL DATA; DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p2; DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t2; DROP TABLE IF EXISTS test.t3; include/sync_slave_sql_with_master.inc include/rpl_end.inc