mirror of
https://github.com/MariaDB/server.git
synced 2025-01-25 00:04:33 +01:00
233 lines
13 KiB
Text
233 lines
13 KiB
Text
include/master-slave.inc
|
|
[connection master]
|
|
connection master;
|
|
select variable_value into @master_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select variable_value into @master_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select variable_value into @master_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select variable_value into @master_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select variable_value into @master_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select variable_value into @master_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select variable_value into @master_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select variable_value into @master_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
connection slave;
|
|
select variable_value into @slave_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select variable_value into @slave_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select variable_value into @slave_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select variable_value into @slave_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select variable_value into @slave_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select variable_value into @slave_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select variable_value into @slave_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select variable_value into @slave_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
connection master;
|
|
CREATE DATABASE testdb;
|
|
USE testdb;
|
|
CREATE TABLE testdb.t1 (i int NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
|
INSERT INTO testdb.t1 VALUES (1);
|
|
connection master;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @master_rows_read;
|
|
@rows_read - @master_rows_read
|
|
0
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @master_rows_updated;
|
|
@rows_updated - @master_rows_updated
|
|
0
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @master_rows_deleted;
|
|
@rows_deleted - @master_rows_deleted
|
|
0
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @master_rows_inserted;
|
|
@rows_inserted - @master_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @master_system_rows_read;
|
|
@system_rows_read - @master_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @master_system_rows_updated;
|
|
@system_rows_updated - @master_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @master_system_rows_deleted;
|
|
@system_rows_deleted - @master_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @master_system_rows_inserted;
|
|
@system_rows_inserted - @master_system_rows_inserted
|
|
0
|
|
connection slave;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @slave_rows_read;
|
|
@rows_read - @slave_rows_read
|
|
0
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @slave_rows_updated;
|
|
@rows_updated - @slave_rows_updated
|
|
0
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @slave_rows_deleted;
|
|
@rows_deleted - @slave_rows_deleted
|
|
0
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @slave_rows_inserted;
|
|
@rows_inserted - @slave_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @slave_system_rows_read;
|
|
@system_rows_read - @slave_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @slave_system_rows_updated;
|
|
@system_rows_updated - @slave_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @slave_system_rows_deleted;
|
|
@system_rows_deleted - @slave_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @slave_system_rows_inserted;
|
|
@system_rows_inserted - @slave_system_rows_inserted
|
|
0
|
|
connection master;
|
|
UPDATE t1 SET i=2 WHERE i=1;
|
|
connection slave;
|
|
connection master;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @master_rows_read;
|
|
@rows_read - @master_rows_read
|
|
1
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @master_rows_updated;
|
|
@rows_updated - @master_rows_updated
|
|
1
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @master_rows_deleted;
|
|
@rows_deleted - @master_rows_deleted
|
|
0
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @master_rows_inserted;
|
|
@rows_inserted - @master_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @master_system_rows_read;
|
|
@system_rows_read - @master_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @master_system_rows_updated;
|
|
@system_rows_updated - @master_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @master_system_rows_deleted;
|
|
@system_rows_deleted - @master_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @master_system_rows_inserted;
|
|
@system_rows_inserted - @master_system_rows_inserted
|
|
0
|
|
connection slave;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @slave_rows_read;
|
|
@rows_read - @slave_rows_read
|
|
1
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @slave_rows_updated;
|
|
@rows_updated - @slave_rows_updated
|
|
1
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @slave_rows_deleted;
|
|
@rows_deleted - @slave_rows_deleted
|
|
0
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @slave_rows_inserted;
|
|
@rows_inserted - @slave_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @slave_system_rows_read;
|
|
@system_rows_read - @slave_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @slave_system_rows_updated;
|
|
@system_rows_updated - @slave_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @slave_system_rows_deleted;
|
|
@system_rows_deleted - @slave_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @slave_system_rows_inserted;
|
|
@system_rows_inserted - @slave_system_rows_inserted
|
|
0
|
|
connection master;
|
|
DELETE FROM t1 WHERE i=2;
|
|
connection master;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @master_rows_read;
|
|
@rows_read - @master_rows_read
|
|
2
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @master_rows_updated;
|
|
@rows_updated - @master_rows_updated
|
|
1
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @master_rows_deleted;
|
|
@rows_deleted - @master_rows_deleted
|
|
1
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @master_rows_inserted;
|
|
@rows_inserted - @master_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @master_system_rows_read;
|
|
@system_rows_read - @master_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @master_system_rows_updated;
|
|
@system_rows_updated - @master_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @master_system_rows_deleted;
|
|
@system_rows_deleted - @master_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @master_system_rows_inserted;
|
|
@system_rows_inserted - @master_system_rows_inserted
|
|
0
|
|
connection slave;
|
|
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
|
select @rows_read - @slave_rows_read;
|
|
@rows_read - @slave_rows_read
|
|
2
|
|
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
|
select @rows_updated - @slave_rows_updated;
|
|
@rows_updated - @slave_rows_updated
|
|
1
|
|
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
|
select @rows_deleted - @slave_rows_deleted;
|
|
@rows_deleted - @slave_rows_deleted
|
|
1
|
|
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
|
select @rows_inserted - @slave_rows_inserted;
|
|
@rows_inserted - @slave_rows_inserted
|
|
1
|
|
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
|
select @system_rows_read - @slave_system_rows_read;
|
|
@system_rows_read - @slave_system_rows_read
|
|
0
|
|
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
|
select @system_rows_updated - @slave_system_rows_updated;
|
|
@system_rows_updated - @slave_system_rows_updated
|
|
0
|
|
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
|
select @system_rows_deleted - @slave_system_rows_deleted;
|
|
@system_rows_deleted - @slave_system_rows_deleted
|
|
0
|
|
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
|
select @system_rows_inserted - @slave_system_rows_inserted;
|
|
@system_rows_inserted - @slave_system_rows_inserted
|
|
0
|
|
connection master;
|
|
DROP TABLE t1;
|
|
DROP DATABASE testdb;
|
|
connection slave;
|
|
include/rpl_end.inc
|