Loading include/my_sys.h +3 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,9 @@ extern void print_defaults(const char *conf_file, const char **groups); extern my_bool my_compress(byte *, ulong *, ulong *); extern my_bool my_uncompress(byte *, ulong *, ulong *); extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); extern int packfrm(const void *, uint, const void **, uint *); extern int unpackfrm(const void **, uint *, const void *); extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); extern uint my_bit_log2(ulong value); extern uint my_count_bits(ulonglong v); Loading mysql-test/r/ndb_restore.result +218 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,223 @@ from (select * from t9 union select * from t9_c) a; count(*) 3 ALTER TABLE t1_c PARTITION BY RANGE (`capgoaledatta`) (PARTITION p0 VALUES LESS THAN MAXVALUE); ALTER TABLE t2_c PARTITION BY LIST(`capgotod`) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6)); ALTER TABLE t3_c PARTITION BY HASH (`CapGoaledatta`); ALTER TABLE t5_c PARTITION BY HASH (`capfa`) PARTITIONS 4; ALTER TABLE t6_c PARTITION BY LINEAR HASH (`relatta`) PARTITIONS 4; ALTER TABLE t7_c PARTITION BY LINEAR KEY (`dardtestard`); drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; select count(*) from t1; count(*) 5 select count(*) from t1_c; count(*) 5 select count(*) from (select * from t1 union select * from t1_c) a; count(*) 5 select count(*) from t2; count(*) 6 select count(*) from t2_c; count(*) 6 select count(*) from (select * from t2 union select * from t2_c) a; count(*) 6 select count(*) from t3; count(*) 4 select count(*) from t3_c; count(*) 4 select count(*) from (select * from t3 union select * from t3_c) a; count(*) 4 select count(*) from t4; count(*) 22 select count(*) from t4_c; count(*) 22 select count(*) from (select * from t4 union select * from t4_c) a; count(*) 22 select count(*) from t5; count(*) 3 select count(*) from t5_c; count(*) 3 select count(*) from (select * from t5 union select * from t5_c) a; count(*) 3 select count(*) from t6; count(*) 8 select count(*) from t6_c; count(*) 8 select count(*) from (select * from t6 union select * from t6_c) a; count(*) 8 select count(*) from t7; count(*) 5 select count(*) from t7_c; count(*) 5 select count(*) from (select * from t7 union select * from t7_c) a; count(*) 5 select count(*) from t8; count(*) 3 select count(*) from t8_c; count(*) 3 select count(*) from (select * from t8 union select * from t8_c) a; count(*) 3 select count(*) from t9; count(*) 3 select count(*) from t9_c; count(*) 3 select count(*) from (select * from t9 union select * from t9_c) a; count(*) 3 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; select count(*) from t1; count(*) 5 select count(*) from t1_c; count(*) 5 select count(*) from (select * from t1 union select * from t1_c) a; count(*) 5 select count(*) from t2; count(*) 6 select count(*) from t2_c; count(*) 6 select count(*) from (select * from t2 union select * from t2_c) a; count(*) 6 select count(*) from t3; count(*) 4 select count(*) from t3_c; count(*) 4 select count(*) from (select * from t3 union select * from t3_c) a; count(*) 4 select count(*) from t4; count(*) 22 select count(*) from t4_c; count(*) 22 select count(*) from (select * from t4 union select * from t4_c) a; count(*) 22 select count(*) from t5; count(*) 3 select count(*) from t5_c; count(*) 3 select count(*) from (select * from t5 union select * from t5_c) a; count(*) 3 select count(*) from t6; count(*) 8 select count(*) from t6_c; count(*) 8 select count(*) from (select * from t6 union select * from t6_c) a; count(*) 8 select count(*) from t7; count(*) 5 select count(*) from t7_c; count(*) 5 select count(*) from (select * from t7 union select * from t7_c) a; count(*) 5 select count(*) from t8; count(*) 3 select count(*) from t8_c; count(*) 3 select count(*) from (select * from t8 union select * from t8_c) a; count(*) 3 select count(*) from t9; count(*) 3 select count(*) from t9_c; count(*) 3 select count(*) from (select * from t9 union select * from t9_c) a; count(*) 3 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; 520093696,1 520093696,2 mysql-test/t/ndb_restore.test +146 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,152 @@ select count(*) from (select * from t9 union select * from t9_c) a; # # Try Partitioned tables as well # ALTER TABLE t1_c PARTITION BY RANGE (`capgoaledatta`) (PARTITION p0 VALUES LESS THAN MAXVALUE); ALTER TABLE t2_c PARTITION BY LIST(`capgotod`) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6)); ALTER TABLE t3_c PARTITION BY HASH (`CapGoaledatta`); ALTER TABLE t5_c PARTITION BY HASH (`capfa`) PARTITIONS 4; ALTER TABLE t6_c PARTITION BY LINEAR HASH (`relatta`) PARTITIONS 4; ALTER TABLE t7_c PARTITION BY LINEAR KEY (`dardtestard`); --exec $NDB_MGM --no-defaults -e "start backup" >> $NDB_TOOLS_OUTPUT drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT select count(*) from t1; select count(*) from t1_c; select count(*) from (select * from t1 union select * from t1_c) a; select count(*) from t2; select count(*) from t2_c; select count(*) from (select * from t2 union select * from t2_c) a; select count(*) from t3; select count(*) from t3_c; select count(*) from (select * from t3 union select * from t3_c) a; select count(*) from t4; select count(*) from t4_c; select count(*) from (select * from t4 union select * from t4_c) a; select count(*) from t5; select count(*) from t5_c; select count(*) from (select * from t5 union select * from t5_c) a; select count(*) from t6; select count(*) from t6_c; select count(*) from (select * from t6 union select * from t6_c) a; select count(*) from t7; select count(*) from t7_c; select count(*) from (select * from t7 union select * from t7_c) a; select count(*) from t8; select count(*) from t8_c; select count(*) from (select * from t8 union select * from t8_c) a; select count(*) from t9; select count(*) from t9_c; select count(*) from (select * from t9 union select * from t9_c) a; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --ndb-nodegroup_map '(0,0)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT select count(*) from t1; select count(*) from t1_c; select count(*) from (select * from t1 union select * from t1_c) a; select count(*) from t2; select count(*) from t2_c; select count(*) from (select * from t2 union select * from t2_c) a; select count(*) from t3; select count(*) from t3_c; select count(*) from (select * from t3 union select * from t3_c) a; select count(*) from t4; select count(*) from t4_c; select count(*) from (select * from t4 union select * from t4_c) a; select count(*) from t5; select count(*) from t5_c; select count(*) from (select * from t5 union select * from t5_c) a; select count(*) from t6; select count(*) from t6_c; select count(*) from (select * from t6 union select * from t6_c) a; select count(*) from t7; select count(*) from t7_c; select count(*) from (select * from t7 union select * from t7_c) a; select count(*) from t8; select count(*) from t8_c; select count(*) from (select * from t8 union select * from t8_c) a; select count(*) from t9; select count(*) from t9_c; select count(*) from (select * from t9 union select * from t9_c) a; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --error 134 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --ndb-nodegroup_map '(0,1)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT # # Cleanup # Loading mysql-test/t/rpl_ndb_bank.test +2 −2 Original line number Diff line number Diff line Loading @@ -114,10 +114,10 @@ CREATE DATABASE BANK; # start by taking a backup on master --connection master RESET MASTER; --exec $NDB_MGM --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT # there is no neat way to find the backupid, this is a hack to find it... --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring=localhost:$NDBCLUSTER_PORT -d sys -D , SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; Loading mysql-test/t/rpl_ndb_sync.test +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; # take a backup on master --exec $NDB_MGM --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -d sys -D , SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT); DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; Loading Loading
include/my_sys.h +3 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,9 @@ extern void print_defaults(const char *conf_file, const char **groups); extern my_bool my_compress(byte *, ulong *, ulong *); extern my_bool my_uncompress(byte *, ulong *, ulong *); extern byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); extern int packfrm(const void *, uint, const void **, uint *); extern int unpackfrm(const void **, uint *, const void *); extern ha_checksum my_checksum(ha_checksum crc, const byte *mem, uint count); extern uint my_bit_log2(ulong value); extern uint my_count_bits(ulonglong v); Loading
mysql-test/r/ndb_restore.result +218 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,223 @@ from (select * from t9 union select * from t9_c) a; count(*) 3 ALTER TABLE t1_c PARTITION BY RANGE (`capgoaledatta`) (PARTITION p0 VALUES LESS THAN MAXVALUE); ALTER TABLE t2_c PARTITION BY LIST(`capgotod`) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6)); ALTER TABLE t3_c PARTITION BY HASH (`CapGoaledatta`); ALTER TABLE t5_c PARTITION BY HASH (`capfa`) PARTITIONS 4; ALTER TABLE t6_c PARTITION BY LINEAR HASH (`relatta`) PARTITIONS 4; ALTER TABLE t7_c PARTITION BY LINEAR KEY (`dardtestard`); drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; select count(*) from t1; count(*) 5 select count(*) from t1_c; count(*) 5 select count(*) from (select * from t1 union select * from t1_c) a; count(*) 5 select count(*) from t2; count(*) 6 select count(*) from t2_c; count(*) 6 select count(*) from (select * from t2 union select * from t2_c) a; count(*) 6 select count(*) from t3; count(*) 4 select count(*) from t3_c; count(*) 4 select count(*) from (select * from t3 union select * from t3_c) a; count(*) 4 select count(*) from t4; count(*) 22 select count(*) from t4_c; count(*) 22 select count(*) from (select * from t4 union select * from t4_c) a; count(*) 22 select count(*) from t5; count(*) 3 select count(*) from t5_c; count(*) 3 select count(*) from (select * from t5 union select * from t5_c) a; count(*) 3 select count(*) from t6; count(*) 8 select count(*) from t6_c; count(*) 8 select count(*) from (select * from t6 union select * from t6_c) a; count(*) 8 select count(*) from t7; count(*) 5 select count(*) from t7_c; count(*) 5 select count(*) from (select * from t7 union select * from t7_c) a; count(*) 5 select count(*) from t8; count(*) 3 select count(*) from t8_c; count(*) 3 select count(*) from (select * from t8 union select * from t8_c) a; count(*) 3 select count(*) from t9; count(*) 3 select count(*) from t9_c; count(*) 3 select count(*) from (select * from t9 union select * from t9_c) a; count(*) 3 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; select count(*) from t1; count(*) 5 select count(*) from t1_c; count(*) 5 select count(*) from (select * from t1 union select * from t1_c) a; count(*) 5 select count(*) from t2; count(*) 6 select count(*) from t2_c; count(*) 6 select count(*) from (select * from t2 union select * from t2_c) a; count(*) 6 select count(*) from t3; count(*) 4 select count(*) from t3_c; count(*) 4 select count(*) from (select * from t3 union select * from t3_c) a; count(*) 4 select count(*) from t4; count(*) 22 select count(*) from t4_c; count(*) 22 select count(*) from (select * from t4 union select * from t4_c) a; count(*) 22 select count(*) from t5; count(*) 3 select count(*) from t5_c; count(*) 3 select count(*) from (select * from t5 union select * from t5_c) a; count(*) 3 select count(*) from t6; count(*) 8 select count(*) from t6_c; count(*) 8 select count(*) from (select * from t6 union select * from t6_c) a; count(*) 8 select count(*) from t7; count(*) 5 select count(*) from t7_c; count(*) 5 select count(*) from (select * from t7 union select * from t7_c) a; count(*) 5 select count(*) from t8; count(*) 3 select count(*) from t8_c; count(*) 3 select count(*) from (select * from t8 union select * from t8_c) a; count(*) 3 select count(*) from t9; count(*) 3 select count(*) from t9_c; count(*) 3 select count(*) from (select * from t9 union select * from t9_c) a; count(*) 3 drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; 520093696,1 520093696,2
mysql-test/t/ndb_restore.test +146 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,152 @@ select count(*) from (select * from t9 union select * from t9_c) a; # # Try Partitioned tables as well # ALTER TABLE t1_c PARTITION BY RANGE (`capgoaledatta`) (PARTITION p0 VALUES LESS THAN MAXVALUE); ALTER TABLE t2_c PARTITION BY LIST(`capgotod`) (PARTITION p0 VALUES IN (0,1,2,3,4,5,6)); ALTER TABLE t3_c PARTITION BY HASH (`CapGoaledatta`); ALTER TABLE t5_c PARTITION BY HASH (`capfa`) PARTITIONS 4; ALTER TABLE t6_c PARTITION BY LINEAR HASH (`relatta`) PARTITIONS 4; ALTER TABLE t7_c PARTITION BY LINEAR KEY (`dardtestard`); --exec $NDB_MGM --no-defaults -e "start backup" >> $NDB_TOOLS_OUTPUT drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT select count(*) from t1; select count(*) from t1_c; select count(*) from (select * from t1 union select * from t1_c) a; select count(*) from t2; select count(*) from t2_c; select count(*) from (select * from t2 union select * from t2_c) a; select count(*) from t3; select count(*) from t3_c; select count(*) from (select * from t3 union select * from t3_c) a; select count(*) from t4; select count(*) from t4_c; select count(*) from (select * from t4 union select * from t4_c) a; select count(*) from t5; select count(*) from t5_c; select count(*) from (select * from t5 union select * from t5_c) a; select count(*) from t6; select count(*) from t6_c; select count(*) from (select * from t6 union select * from t6_c) a; select count(*) from t7; select count(*) from t7_c; select count(*) from (select * from t7 union select * from t7_c) a; select count(*) from t8; select count(*) from t8_c; select count(*) from (select * from t8 union select * from t8_c) a; select count(*) from t9; select count(*) from t9_c; select count(*) from (select * from t9 union select * from t9_c) a; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --ndb-nodegroup_map '(0,0)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT select count(*) from t1; select count(*) from t1_c; select count(*) from (select * from t1 union select * from t1_c) a; select count(*) from t2; select count(*) from t2_c; select count(*) from (select * from t2 union select * from t2_c) a; select count(*) from t3; select count(*) from t3_c; select count(*) from (select * from t3 union select * from t3_c) a; select count(*) from t4; select count(*) from t4_c; select count(*) from (select * from t4 union select * from t4_c) a; select count(*) from t5; select count(*) from t5_c; select count(*) from (select * from t5 union select * from t5_c) a; select count(*) from t6; select count(*) from t6_c; select count(*) from (select * from t6 union select * from t6_c) a; select count(*) from t7; select count(*) from t7_c; select count(*) from (select * from t7 union select * from t7_c) a; select count(*) from t8; select count(*) from t8_c; select count(*) from (select * from t8 union select * from t8_c) a; select count(*) from t9; select count(*) from t9_c; select count(*) from (select * from t9 union select * from t9_c) a; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --error 134 --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 2 -n 1 -m -r --ndb-nodegroup_map '(0,1)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-2 >> $NDB_TOOLS_OUTPUT # # Cleanup # Loading
mysql-test/t/rpl_ndb_bank.test +2 −2 Original line number Diff line number Diff line Loading @@ -114,10 +114,10 @@ CREATE DATABASE BANK; # start by taking a backup on master --connection master RESET MASTER; --exec $NDB_MGM --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT # there is no neat way to find the backupid, this is a hack to find it... --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring=localhost:$NDBCLUSTER_PORT -d sys -D , SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; Loading
mysql-test/t/rpl_ndb_sync.test +2 −2 Original line number Diff line number Diff line Loading @@ -25,8 +25,8 @@ SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; # take a backup on master --exec $NDB_MGM --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring=localhost:$NDBCLUSTER_PORT -d sys -D , SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT); DELETE FROM cluster_replication.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; Loading