Merge mysql.com:/home/marty/MySQL/mysql-5.0-ndb

into  mysql.com:/home/marty/MySQL/mysql-5.1-new-ndb
parents a4523478 571a7bb3
set autocommit=1;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
f n Query 1 n use `test`; insert into bug16206 values(0)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; BEGIN
f n Query 1 n use `test`; insert into bug16206 values(2)
f n Query 1 n use `test`; COMMIT
f n Query 1 n use `test`; insert into bug16206 values(3)
drop table bug16206;
set autocommit=0;
End of 5.0 tests
...@@ -33,15 +33,13 @@ CREATE TABLE `t2_c` ( ...@@ -33,15 +33,13 @@ 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'),(5,0,'',NULL,NULL,''); 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');
# 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 ROW_FORMAT=FIXED; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
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
...@@ -149,8 +147,8 @@ INSERT INTO `t9_c` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net',' ...@@ -149,8 +147,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 DEFAULT CHARSET=latin1; create table t10_c (a int auto_increment key) ENGINE=ndbcluster;
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);
...@@ -166,27 +164,14 @@ create table t8 engine=myisam as select * from t8_c; ...@@ -166,27 +164,14 @@ 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
# Bug #30667 show tables;
# 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;
...@@ -246,157 +231,25 @@ select count(*) ...@@ -246,157 +231,25 @@ select count(*)
select * from t10_c order by a; select * from t10_c order by a;
# Bug #27775 cont'd # Bug #27775 cont'd
# - auto inc info should be correct # - auto inc info should be correct
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select max(capgoaledatta) from t1_c;
show table status like 't1_c'; select auto_increment from information_schema.tables
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X where table_name = 't1_c';
show table status like 't2_c'; select max(capgotod) from t2_c;
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select auto_increment from information_schema.tables
show table status like 't4_c'; where table_name = 't2_c';
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X select max(capfa) from t4_c;
show table status like 't7_c'; select auto_increment from information_schema.tables
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X 10 X 12 X 13 X 14 X 15 X 16 X 17 X 18 X where table_name = 't4_c';
show table status like 't10_c'; select max(dardtestard) from t7_c;
select auto_increment from information_schema.tables
# where table_name = 't7_c';
# Try Partitioned tables as well select max(a) from t10_c;
# select auto_increment from information_schema.tables
ALTER TABLE t7_c where table_name = 't10_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 t2_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;
--enable_warnings --enable_warnings
# #
......
-- source include/not_embedded.inc
-- source include/have_bdb.inc
#
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
#
set autocommit=1;
let $VERSION=`select version()`;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
set autocommit=0;
--echo End of 5.0 tests
...@@ -1540,12 +1540,12 @@ public: ...@@ -1540,12 +1540,12 @@ public:
int readAutoIncrementValue(const NdbDictionary::Table * aTable, int readAutoIncrementValue(const NdbDictionary::Table * aTable,
TupleIdRange & range, Uint64 & tupleId); TupleIdRange & range, Uint64 & tupleId);
int setAutoIncrementValue(const char* aTableName, int setAutoIncrementValue(const char* aTableName,
Uint64 tupleId, bool increase); Uint64 tupleId, bool modify);
int setAutoIncrementValue(const NdbDictionary::Table * aTable, int setAutoIncrementValue(const NdbDictionary::Table * aTable,
Uint64 tupleId, bool increase); Uint64 tupleId, bool modify);
int setAutoIncrementValue(const NdbDictionary::Table * aTable, int setAutoIncrementValue(const NdbDictionary::Table * aTable,
TupleIdRange & range, Uint64 tupleId, TupleIdRange & range, Uint64 tupleId,
bool increase); bool modify);
private: private:
int getTupleIdFromNdb(const NdbTableImpl* table, int getTupleIdFromNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 & tupleId, TupleIdRange & range, Uint64 & tupleId,
...@@ -1553,7 +1553,7 @@ private: ...@@ -1553,7 +1553,7 @@ private:
int readTupleIdFromNdb(const NdbTableImpl* table, int readTupleIdFromNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 & tupleId); TupleIdRange & range, Uint64 & tupleId);
int setTupleIdInNdb(const NdbTableImpl* table, int setTupleIdInNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 tupleId, bool increase); TupleIdRange & range, Uint64 tupleId, bool modify);
int opTupleIdOnNdb(const NdbTableImpl* table, int opTupleIdOnNdb(const NdbTableImpl* table,
TupleIdRange & range, Uint64 & opValue, Uint32 op); TupleIdRange & range, Uint64 & opValue, Uint32 op);
public: public:
......
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