mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here copies for Maria.
This commit is contained in:
@ -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;
|
||||
|
@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` (
|
||||
`c` int(11) NOT NULL DEFAULT '0',
|
||||
`d` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`,`b`,`c`) USING HASH
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (b) */
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int not null primary key)
|
||||
PARTITION BY KEY(a)
|
||||
@ -122,19 +123,28 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = ndbcluster,
|
||||
PARTITION p1 ENGINE = ndbcluster) */
|
||||
alter table t1 engine=heap;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = MEMORY,
|
||||
PARTITION p1 ENGINE = MEMORY) */
|
||||
alter table t1 engine=ndb;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = ndbcluster,
|
||||
PARTITION p1 ENGINE = ndbcluster) */
|
||||
alter table t1 engine=heap remove partitioning;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
@ -148,7 +158,10 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = ndbcluster,
|
||||
PARTITION p1 ENGINE = ndbcluster) */
|
||||
alter table t1
|
||||
partition by key (a)
|
||||
(partition p0 engine=ndb, partition p1 engine=ndb);
|
||||
@ -156,7 +169,10 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = ndbcluster,
|
||||
PARTITION p1 ENGINE = ndbcluster) */
|
||||
alter table t1 remove partitioning;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
@ -174,7 +190,10 @@ show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
(PARTITION p0 ENGINE = ndbcluster,
|
||||
PARTITION p1 ENGINE = ndbcluster) */
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
||||
|
@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` (
|
||||
`c` int(11) NOT NULL,
|
||||
PRIMARY KEY (`b`),
|
||||
UNIQUE KEY `a` (`a`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE (b)
|
||||
(PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster,
|
||||
PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster,
|
||||
PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
|
||||
drop table t1;
|
||||
CREATE TABLE t1
|
||||
(id MEDIUMINT NOT NULL,
|
||||
|
@ -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
|
||||
|
@ -411,13 +411,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
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user