⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ndb_binlog_basic.test

📁 开启mysql的远程连接的方法 mysql-noinstall-5.1.6-alpha-win32.zip
💻 TEST
字号:
-- source include/have_ndb.inc-- source include/have_binlog_format_row.inc--disable_warningsdrop table if exists t1, t2;drop database if exists mysqltest;create database mysqltest;use mysqltest;drop database mysqltest;use test;--enable_warnings## basic insert, update, delete test, alter, rename, drop# check that binlog_index gets the right info#create table t1 (a int primary key) engine=ndb;insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);save_master_pos;--replace_column 1 #select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index;delete from t1;alter table t1 add (b int);insert into t1 values (3,3),(4,4);alter table t1 rename t2;# get all in one epochbegin;insert into t2 values (1,1),(2,2);update t2 set b=1 where a=3;delete from t2 where a=4;commit;drop table t2;# check that above is ok# (save_master_pos waits for last gcp to complete, ensuring that we have#  the expected data in the binlog)save_master_pos;select inserts from cluster_replication.binlog_index where epoch > @max_epoch and inserts > 5;select deletes from cluster_replication.binlog_index where epoch > @max_epoch and deletes > 5;select inserts,updates,deletes from   cluster_replication.binlog_index where epoch > @max_epoch and updates > 0;select schemaops from   cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0;## check that purge clears the binlog_index#flush logs;--sleep 1purge master logs before now();select count(*) from cluster_replication.binlog_index;## several tables in different databases# check that same table name in different databases don't mix up#create table t1 (a int primary key, b int) engine=ndb;create database mysqltest;use mysqltest;create table t1 (c int, d int primary key) engine=ndb;use test;insert into mysqltest.t1 values (2,1),(2,2);save_master_pos;--replace_column 1 #select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index;drop table t1;drop database mysqltest;select inserts,updates,deletes from   cluster_replication.binlog_index where epoch > @max_epoch and inserts > 0;select schemaops from  cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -