| 1 |
--source include/have_ndb.inc |
| 2 |
--source include/have_binlog_format_mixed_or_row.inc |
| 3 |
--source suite/ndb_rpl/ndb_master-slave.inc |
| 4 |
|
| 5 |
CREATE TABLE `loadreptable` ( |
| 6 |
`nid` int(11) NOT NULL, |
| 7 |
`nom` char(255) DEFAULT NULL, |
| 8 |
`prenom` char(255) DEFAULT NULL, |
| 9 |
`abc` char(255) DEFAULT NULL, |
| 10 |
`wkz` char(255) DEFAULT NULL, |
| 11 |
`xyz` char(255) DEFAULT NULL, |
| 12 |
PRIMARY KEY (`nid`) USING HASH |
| 13 |
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; |
| 14 |
|
| 15 |
delimiter //; |
| 16 |
CREATE PROCEDURE MAJ () |
| 17 |
BEGIN |
| 18 |
DECLARE fini INT default 0; |
| 19 |
WHILE fini < 20 DO |
| 20 |
DELETE FROM loadreptable WHERE nid > 2; |
| 21 |
UPDATE loadreptable SET nid=nid+1 ORDER BY nid DESC; |
| 22 |
UPDATE loadreptable SET |
| 23 |
nom="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 24 |
xxx"; |
| 25 |
INSERT INTO loadreptable VALUES(1,"w","t","y","k","b"); |
| 26 |
SET fini=fini+1; |
| 27 |
END WHILE; |
| 28 |
END ; |
| 29 |
// |
| 30 |
delimiter ;// |
| 31 |
|
| 32 |
--sync_slave_with_master |
| 33 |
|
| 34 |
let $i=10; |
| 35 |
while ($i) |
| 36 |
{ |
| 37 |
--connection master |
| 38 |
call MAJ(); |
| 39 |
--echo "master" |
| 40 |
select count(*) from loadreptable; |
| 41 |
--sync_slave_with_master |
| 42 |
--connection slave |
| 43 |
--echo "slave" |
| 44 |
select count(*) from loadreptable; |
| 45 |
dec $i; |
| 46 |
} |
| 47 |
|
| 48 |
--connection master |
| 49 |
drop table loadreptable; |
| 50 |
drop procedure MAJ; |
| 51 |
|
| 52 |
--sync_slave_with_master |
| 53 |
--source include/rpl_end.inc |