ndb_restore.result, ndb_restore.test:

  Changed to use information_schema to check auto_increment
Ndb.cpp:
  Bug #33534   Bad performance of INSERT's in auto_incremented tables: Saving highest seen value when setting auto_increment fields
ndb_auto_increment.result:
  Regenerated result
parent bfdb45df
...@@ -421,10 +421,10 @@ select * from t1 order by a; ...@@ -421,10 +421,10 @@ select * from t1 order by a;
a a
1 1
20 20
21
33 33
34 34
35 35
65
insert into t1 values (100); insert into t1 values (100);
insert into t1 values (NULL); insert into t1 values (NULL);
insert into t1 values (NULL); insert into t1 values (NULL);
...@@ -432,11 +432,11 @@ select * from t1 order by a; ...@@ -432,11 +432,11 @@ select * from t1 order by a;
a a
1 1
20 20
21
22
33 33
34 34
35 35
65
66
100 100
101 101
set auto_increment_offset = @old_auto_increment_offset; set auto_increment_offset = @old_auto_increment_offset;
......
...@@ -18,12 +18,12 @@ CREATE TABLE `t2_c` ( ...@@ -18,12 +18,12 @@ CREATE TABLE `t2_c` (
PRIMARY KEY (`capgotod`), PRIMARY KEY (`capgotod`),
KEY `i quadaddsvr` (`gotod`) KEY `i quadaddsvr` (`gotod`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
CREATE TABLE `t3_c` ( CREATE TABLE `t3_c` (
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0', `CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
`capgotod` smallint(5) unsigned NOT NULL default '0', `capgotod` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capgotod`,`CapGoaledatta`) PRIMARY KEY (`capgotod`,`CapGoaledatta`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3); INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
CREATE TABLE `t4_c` ( CREATE TABLE `t4_c` (
`capfa` bigint(20) unsigned NOT NULL auto_increment, `capfa` bigint(20) unsigned NOT NULL auto_increment,
...@@ -116,8 +116,8 @@ CREATE TABLE `t9_c` ( ...@@ -116,8 +116,8 @@ CREATE TABLE `t9_c` (
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
create table t10_c (a int auto_increment key) ENGINE=ndbcluster; CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
insert into t10_c values (1),(2),(3); INSERT INTO t10_c VALUES (1),(2),(3);
insert into t10_c values (10000),(2000),(3000); insert into t10_c values (10000),(2000),(3000);
create table t1 engine=myisam as select * from t1_c; create table t1 engine=myisam as select * from t1_c;
create table t2 engine=myisam as select * from t2_c; create table t2 engine=myisam as select * from t2_c;
...@@ -129,6 +129,8 @@ create table t7 engine=myisam as select * from t7_c; ...@@ -129,6 +129,8 @@ create table t7 engine=myisam as select * from t7_c;
create table t8 engine=myisam as select * from t8_c; create table t8 engine=myisam as select * from t8_c;
create table t9 engine=myisam as select * from t9_c; create table t9 engine=myisam as select * from t9_c;
create table t10 engine=myisam as select * from t10_c; create table t10 engine=myisam as select * from t10_c;
ForceVarPart: 0
ForceVarPart: 1
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info; DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
...@@ -136,29 +138,14 @@ SELECT @the_backup_id:=backup_id FROM test.backup_info; ...@@ -136,29 +138,14 @@ SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
DROP TABLE test.backup_info; DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
show tables; ForceVarPart: 0
Tables_in_test ForceVarPart: 1
t1 select * from information_schema.columns where table_name = "t1_c";
t10 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
t2 NULL test t1_c capgoaledatta 1 NULL NO mediumint NULL NULL 7 0 NULL NULL mediumint(5) unsigned PRI auto_increment select,insert,update,references
t3 NULL test t1_c goaledatta 2 NO char 2 2 NULL NULL latin1 latin1_swedish_ci char(2) PRI select,insert,update,references
t4 NULL test t1_c maturegarbagefa 3 NO varchar 32 32 NULL NULL latin1 latin1_swedish_ci varchar(32) PRI select,insert,update,references
t5
t6
t7
t8
t9
t4_c
t3_c
t2_c
t5_c
t6_c
t7_c
t8_c
t9_c
t10_c
t1_c
select count(*) from t1; select count(*) from t1;
count(*) count(*)
5 5
...@@ -172,15 +159,15 @@ count(*) ...@@ -172,15 +159,15 @@ count(*)
5 5
select count(*) from t2; select count(*) from t2;
count(*) count(*)
6 7
select count(*) from t2_c; select count(*) from t2_c;
count(*) count(*)
6 7
select count(*) select count(*)
from (select * from t2 union from (select * from t2 union
select * from t2_c) a; select * from t2_c) a;
count(*) count(*)
6 7
select count(*) from t3; select count(*) from t3;
count(*) count(*)
4 4
...@@ -301,6 +288,223 @@ select auto_increment from information_schema.tables ...@@ -301,6 +288,223 @@ select auto_increment from information_schema.tables
where table_name = 't10_c'; where table_name = 't10_c';
auto_increment auto_increment
10001 10001
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; ALTER TABLE t7_c
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; PARTITION BY LINEAR KEY (`dardtestard`);
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_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(*)
7
select count(*) from t2_c;
count(*)
7
select count(*)
from (select * from t2 union
select * from t2_c) a;
count(*)
7
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,t10_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(*)
7
select count(*) from t2_c;
count(*)
7
select count(*)
from (select * from t2 union
select * from t2_c) a;
count(*)
7
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,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
drop table if exists t2_c;
520093696,<the_backup_id> 520093696,<the_backup_id>
...@@ -33,13 +33,15 @@ CREATE TABLE `t2_c` ( ...@@ -33,13 +33,15 @@ CREATE TABLE `t2_c` (
PRIMARY KEY (`capgotod`), PRIMARY KEY (`capgotod`),
KEY `i quadaddsvr` (`gotod`) KEY `i quadaddsvr` (`gotod`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); INSERT INTO `t2_c` VALUES (500,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'),(5,0,'',NULL,NULL,'');
# Added ROW_FORMAT=FIXED to use below to see that setting is preserved
# by restore
CREATE TABLE `t3_c` ( CREATE TABLE `t3_c` (
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0', `CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
`capgotod` smallint(5) unsigned NOT NULL default '0', `capgotod` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capgotod`,`CapGoaledatta`) PRIMARY KEY (`capgotod`,`CapGoaledatta`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED;
INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3); INSERT INTO `t3_c` VALUES (5,3),(2,4),(5,4),(1,3);
# Bug #27775 - mediumint auto inc not restored correctly # Bug #27775 - mediumint auto inc not restored correctly
...@@ -147,8 +149,8 @@ INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net',' ...@@ -147,8 +149,8 @@ INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','
# auto inc table not handled correctly when restored from cluster backup # auto inc table not handled correctly when restored from cluster backup
# - before fix ndb_restore would not set auto inc value correct, # - before fix ndb_restore would not set auto inc value correct,
# seen by select below # seen by select below
create table t10_c (a int auto_increment key) ENGINE=ndbcluster; CREATE TABLE t10_c (a INT AUTO_INCREMENT KEY) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
insert into t10_c values (1),(2),(3); INSERT INTO t10_c VALUES (1),(2),(3);
# Bug #27775 - mediumint auto inc not restored correctly # Bug #27775 - mediumint auto inc not restored correctly
# - check int # - check int
insert into t10_c values (10000),(2000),(3000); insert into t10_c values (10000),(2000),(3000);
...@@ -164,14 +166,27 @@ create table t8 engine=myisam as select * from t8_c; ...@@ -164,14 +166,27 @@ create table t8 engine=myisam as select * from t8_c;
create table t9 engine=myisam as select * from t9_c; create table t9 engine=myisam as select * from t9_c;
create table t10 engine=myisam as select * from t10_c; create table t10 engine=myisam as select * from t10_c;
# check that force varpart is preserved by ndb_restore
# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
--source include/ndb_backup.inc --source include/ndb_backup.inc
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
# check that force varpart is preserved by ndb_restore
# t3_c has ROW_FORMAT=FIXED i.e. ForceVarPart=0
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t3_c | grep ForceVarPart
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t2_c | grep ForceVarPart
show tables; # Bug #30667
# ndb table discovery does not work correcly with information schema
# - prior to bug fix this would yeild no output and a warning
select * from information_schema.columns where table_name = "t1_c";
# random output order??
#show tables;
select count(*) from t1; select count(*) from t1;
select count(*) from t1_c; select count(*) from t1_c;
...@@ -247,9 +262,146 @@ select max(a) from t10_c; ...@@ -247,9 +262,146 @@ select max(a) from t10_c;
select auto_increment from information_schema.tables select auto_increment from information_schema.tables
where table_name = 't10_c'; where table_name = 't10_c';
#
# Try Partitioned tables as well
#
ALTER TABLE t7_c
PARTITION BY LINEAR KEY (`dardtestard`);
--source include/ndb_backup.inc
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $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,t10_c;
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,0)' --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $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 all table except t2_c
# This to make sure that error returned from ndb_restore above is
# guaranteed to be from t2_c, this since order of tables in backup
# is none deterministic
#
drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c,t10_c;
--source include/ndb_backup.inc
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --core=0 -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,1)' $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id 2>&1 | grep Translate || true
#
# Cleanup
#
--disable_warnings --disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9, t10; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c, t10_c; drop table if exists t2_c;
--enable_warnings --enable_warnings
# #
......
...@@ -1399,15 +1399,15 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table, ...@@ -1399,15 +1399,15 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table,
tOperation->write_attr("NEXTID", 1); tOperation->write_attr("NEXTID", 1);
tOperation->interpret_exit_ok(); tOperation->interpret_exit_ok();
tOperation->def_label(0); tOperation->def_label(0);
tOperation->interpret_exit_nok(9999); tOperation->interpret_exit_ok();
tRecAttrResult = tOperation->getValue("NEXTID");
if (tConnection->execute( NdbTransaction::Commit ) == -1) if (tConnection->execute( NdbTransaction::Commit ) == -1)
{ {
if (tConnection->theError.code != 9999) goto error_handler;
goto error_handler;
} }
else else
{ {
range.m_highest_seen = tRecAttrResult->u_64_value();
DBUG_PRINT("info", DBUG_PRINT("info",
("Setting next auto increment value (db) to %lu", ("Setting next auto increment value (db) to %lu",
(ulong) opValue)); (ulong) opValue));
...@@ -1420,7 +1420,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table, ...@@ -1420,7 +1420,7 @@ Ndb::opTupleIdOnNdb(const NdbTableImpl* table,
tRecAttrResult = tOperation->getValue("NEXTID"); tRecAttrResult = tOperation->getValue("NEXTID");
if (tConnection->execute( NdbTransaction::Commit ) == -1 ) if (tConnection->execute( NdbTransaction::Commit ) == -1 )
goto error_handler; goto error_handler;
opValue = tRecAttrResult->u_64_value(); // out range.m_highest_seen = opValue = tRecAttrResult->u_64_value(); // out
break; break;
default: default:
goto error_handler; goto error_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment