diff options
author | Mats Kindahl <mats@sun.com> | 2008-10-23 21:27:09 +0200 |
---|---|---|
committer | Mats Kindahl <mats@sun.com> | 2008-10-23 21:27:09 +0200 |
commit | 1f29c525818b421bda822550a92cb6f7092dcec8 (patch) | |
tree | 09212d65be943c6c5dfd6d6a834841683d81f9f8 /mysql-test/suite/ndb | |
parent | d88716c2cf990ae8e6b2de75612219b22259b3cf (diff) | |
parent | 3c76b5a10405a019422a6617be8e6b22a8da8953 (diff) | |
download | mariadb-git-1f29c525818b421bda822550a92cb6f7092dcec8.tar.gz |
Merging 5.1 main into 5.1-rpl
Diffstat (limited to 'mysql-test/suite/ndb')
-rw-r--r-- | mysql-test/suite/ndb/r/ndb_alter_table.result | 52 | ||||
-rw-r--r-- | mysql-test/suite/ndb/t/disabled.def | 1 | ||||
-rw-r--r-- | mysql-test/suite/ndb/t/ndb_alter_table.test | 29 | ||||
-rw-r--r-- | mysql-test/suite/ndb/t/ndb_restore_print.test | 20 |
4 files changed, 80 insertions, 22 deletions
diff --git a/mysql-test/suite/ndb/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result index 5798db73403..35b983e1901 100644 --- a/mysql-test/suite/ndb/r/ndb_alter_table.result +++ b/mysql-test/suite/ndb/r/ndb_alter_table.result @@ -354,16 +354,52 @@ select * from t1 where a = 12; a b c 12 403 NULL drop table t1; -create table t1 (a int not null, b varchar(10)) engine=ndb; -show index from t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +create table t1(a int not null) engine=ndb; +$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY($PK) - UniqueHashIndex +insert into t1 values (1),(2),(3); alter table t1 add primary key (a); -show index from t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 a A 0 NULL NULL BTREE +a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY(a) - UniqueHashIndex +PRIMARY(a) - OrderedIndex +update t1 set a = 17 where a = 1; +select * from t1 order by a; +a +2 +3 +17 alter table t1 drop primary key; -show index from t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY($PK) - UniqueHashIndex +update t1 set a = 1 where a = 17; +select * from t1 order by a; +a +1 +2 +3 +drop table t1; +create table t1(a int not null) engine=ndb; +$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY($PK) - UniqueHashIndex +insert into t1 values (1),(2),(3); +create unique index pk on t1(a); +a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY(a) - UniqueHashIndex +update t1 set a = 17 where a = 1; +select * from t1 order by a; +a +2 +3 +17 +alter table t1 drop index pk; +$PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY +PRIMARY KEY($PK) - UniqueHashIndex +update t1 set a = 1 where a = 17; +select * from t1 order by a; +a +1 +2 +3 drop table t1; create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb; show create table t1; diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index 6102d182684..c638c7b4774 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -12,6 +12,5 @@ partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms -ndb_index_ordered : Bug#38370 The test ndb.ndb_index_ordered fails with the community features on # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/suite/ndb/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test index 6dc3088137d..bf0f8a540bb 100644 --- a/mysql-test/suite/ndb/t/ndb_alter_table.test +++ b/mysql-test/suite/ndb/t/ndb_alter_table.test @@ -412,13 +412,32 @@ select * from t1 where a = 12; drop table t1; # some other ALTER combinations -# add/drop pk -create table t1 (a int not null, b varchar(10)) engine=ndb; -show index from t1; +# Check add/drop primary key (not supported on-line) +create table t1(a int not null) engine=ndb; +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +insert into t1 values (1),(2),(3); alter table t1 add primary key (a); -show index from t1; +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +update t1 set a = 17 where a = 1; +select * from t1 order by a; alter table t1 drop primary key; -show index from t1; +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +update t1 set a = 1 where a = 17; +select * from t1 order by a; +drop table t1; + +# bug#31233 mysql_alter_table() fails to drop UNIQUE KEY +create table t1(a int not null) engine=ndb; +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +insert into t1 values (1),(2),(3); +create unique index pk on t1(a); +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +update t1 set a = 17 where a = 1; +select * from t1 order by a; +alter table t1 drop index pk; +--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | grep PRIMARY +update t1 set a = 1 where a = 17; +select * from t1 order by a; drop table t1; # alter .. alter diff --git a/mysql-test/suite/ndb/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test index 6dbbfdf5933..9a880f8968c 100644 --- a/mysql-test/suite/ndb/t/ndb_restore_print.test +++ b/mysql-test/suite/ndb/t/ndb_restore_print.test @@ -134,10 +134,14 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); --let ndb_restore_filter=test t1 --source include/ndb_backup_print.inc ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt +--error 0,1 +--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt --let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append --let ndb_restore_filter=test @@ -156,10 +160,10 @@ insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35); --source include/show_msg.inc --exec sort $MYSQLTEST_VARDIR/tmp/t4.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t1.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t2.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t3.txt ---exec rm -f $MYSQLTEST_VARDIR/tmp/t4.txt +--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt +--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt +--remove_file $MYSQLTEST_VARDIR/tmp/t3.txt +--remove_file $MYSQLTEST_VARDIR/tmp/t4.txt # now test some other datatypes drop table t1; |