Server IP : 172.67.216.182 / Your IP : 172.71.82.108 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/ndb_binlog/r/ |
Upload File : |
create table ba(ks int primary key, st int, lp int) engine = ndb; insert into ba values (1, 1, 1), (2,2,2), (3,3,3), (4,4,4); update ba set lp=40 where ks=4; delete from ba where ks=2; flush logs; flush logs; flush logs; flush logs; delete from ba; show variables like 'ndb_log_update%'; Variable_name Value ndb_log_update_as_write ON ndb_log_updated_only ON select txt from binlog_stmts where txt not like '%ndb_apply_status%' order by txt; txt DELETE FROM `test`.`ba` WHERE @1=2 INSERT INTO `test`.`ba` SET @1=1 @2=1 @3=1 INSERT INTO `test`.`ba` SET @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=3 @2=3 @3=3 INSERT INTO `test`.`ba` SET @1=4 @2=4 @3=4 INSERT INTO `test`.`ba` SET @1=4 @3=40 select * from ba order by ks; ks st lp 1 1 1 3 3 3 4 4 40 delete from ba; show variables like 'ndb_log_update%'; Variable_name Value ndb_log_update_as_write ON ndb_log_updated_only OFF select txt from binlog_stmts where txt not like '%ndb_apply_status%' order by txt; txt DELETE FROM `test`.`ba` WHERE @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=1 @2=1 @3=1 INSERT INTO `test`.`ba` SET @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=3 @2=3 @3=3 INSERT INTO `test`.`ba` SET @1=4 @2=4 @3=4 INSERT INTO `test`.`ba` SET @1=4 @2=4 @3=40 select * from ba order by ks; ks st lp 1 1 1 3 3 3 4 4 40 delete from ba; show variables like 'ndb_log_update%'; Variable_name Value ndb_log_update_as_write OFF ndb_log_updated_only ON select txt from binlog_stmts where txt not like '%ndb_apply_status%' order by txt; txt DELETE FROM `test`.`ba` WHERE @1=2 INSERT INTO `test`.`ba` SET @1=1 @2=1 @3=1 INSERT INTO `test`.`ba` SET @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=3 @2=3 @3=3 INSERT INTO `test`.`ba` SET @1=4 @2=4 @3=4 UPDATE `test`.`ba` WHERE @1=4 @3=4 SET @1=4 @3=40 select * from ba order by ks; ks st lp 1 1 1 3 3 3 4 4 40 delete from ba; show variables like 'ndb_log_update%'; Variable_name Value ndb_log_update_as_write OFF ndb_log_updated_only OFF select txt from binlog_stmts where txt not like '%ndb_apply_status%' order by txt; txt DELETE FROM `test`.`ba` WHERE @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=1 @2=1 @3=1 INSERT INTO `test`.`ba` SET @1=2 @2=2 @3=2 INSERT INTO `test`.`ba` SET @1=3 @2=3 @3=3 INSERT INTO `test`.`ba` SET @1=4 @2=4 @3=4 UPDATE `test`.`ba` WHERE @1=4 @2=4 @3=4 SET @1=4 @2=4 @3=40 select * from ba order by ks; ks st lp 1 1 1 3 3 3 4 4 40 drop table ba; reset master; show variables like 'ndb_log_update%'; Variable_name Value ndb_log_update_as_write ON ndb_log_updated_only ON create table bah (tst int primary key, cvy int, sqs int, unique(sqs)) engine=ndb; insert into bah values (1,1,1); update bah set cvy= 2 where tst=1; select * from bah order by tst; tst cvy sqs 1 2 1 drop table bah; Manually applying captured binlog select * from bah order by tst; tst cvy sqs 1 2 1 drop table bah; reset master; show variables like '%log_update%'; Variable_name Value ndb_log_update_as_write ON ndb_log_updated_only ON CREATE TABLE `t1` ( `charId` varchar(60) NOT NULL, `enumId` enum('A','B','C') NOT NULL, `val` bigint(20) NOT NULL, `version` int(11) NOT NULL, PRIMARY KEY (`charId`,`enumId`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES ('', 'A', 0, 1); FLUSH LOGS; UPDATE t1 SET val = val + 1 WHERE charId = ''; FLUSH LOGS; DELETE FROM t1 WHERE charId = ''; FLUSH LOGS; Manually applying captured binlog select * from t1; charId enumId val version drop table t1; reset master; show variables like '%log_update%'; Variable_name Value ndb_log_update_as_write ON ndb_log_updated_only ON create table t1 (pk int not null primary key, name varchar(256)) engine = ndb; FLUSH LOGS; insert into t1 values (0, "zero"),(1,"one"),(2,"two"),(3,"three"),(4,"four"),(5,"five"),(6,"six"),(7,"seven"),(8,"eight"),(9,"nine"); select * from t1 order by pk; pk name 0 zero 1 one 2 two 3 three 4 four 5 five 6 six 7 seven 8 eight 9 nine update t1 set name = "even" where pk in (0,2,4,6,8); update t1 set name = "odd" where pk in (1,3,5,7,9); delete from t1 where name = "odd"; select * from t1 order by pk; pk name 0 even 2 even 4 even 6 even 8 even FLUSH LOGS; truncate t1; insert into t1 values (0, "zero"),(1,"one"),(2,"two"),(3,"three"),(4,"four"),(5,"five"),(6,"six"),(7,"seven"),(8,"eight"),(9,"nine"); select * from t1 order by pk; pk name 0 zero 1 one 2 two 3 three 4 four 5 five 6 six 7 seven 8 eight 9 nine FLUSH LOGS; Manually applying captured binlog select * from t1 order by pk; pk name 0 even 2 even 4 even 6 even 8 even drop table t1;