summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-05-10 12:53:40 -0400
committerunknown <mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se>2006-05-10 12:53:40 -0400
commit4e3f4e970f6476d3b6b79077e26ddcb5a24ef80a (patch)
tree15485e03be56b9839d6e8ab9f610939e568fad1b /mysql-test
parent3065eeb3f8cff732e1a462b58996105881c7ca88 (diff)
downloadmariadb-git-4e3f4e970f6476d3b6b79077e26ddcb5a24ef80a.tar.gz
BUG#19010: Fix issues with that ALTER TABLE from auto-partitioned NDB table doesn't work unless primary key exists on table.
mysql-test/r/ndb_bitfield.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/r/ndb_dd_basic.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/r/ndb_dd_disk2memory.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/r/ndb_gis.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/r/ndb_partition_key.result: New test cases for auto-partitioning change that was made to fix bug mysql-test/r/rpl_ndb_UUID.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/r/rpl_ndb_dd_advance.result: Test cases changes now that auto-partitioning is remembered in frm file mysql-test/t/ndb_partition_key.test: New test cases for auto-partitioning change that was made to fix bug sql/partition_info.h: New boolean to keep track of auto partitioned or not sql/sql_partition.cc: Ensure that auto-partitiong flag is reset when partitions are dropped, added, reorganised or coalesced. Ensure that auto-partitioned tables are altered into non-partitioned table when ALTER TABLE t1 engine=X is performed. sql/sql_show.cc: Only print partition info for non-auto-partitioned tables sql/sql_table.cc: Set auto partition flag when auto partitions are generated in create table sql/table.cc: Fix reading of frm file where new auto-partition flag is introduced. sql/table.h: New flag for auto partition on share object sql/unireg.cc: Fix code for writing frm to also write autopartition flag at end of partition info, fix some length issues at the same time that was in this part that caused no problems since partition info always was the last info in the file.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_bitfield.result2
-rw-r--r--mysql-test/r/ndb_dd_basic.result2
-rw-r--r--mysql-test/r/ndb_dd_disk2memory.result8
-rw-r--r--mysql-test/r/ndb_gis.result4
-rw-r--r--mysql-test/r/ndb_partition_key.result39
-rw-r--r--mysql-test/r/rpl_ndb_UUID.result2
-rw-r--r--mysql-test/r/rpl_ndb_dd_advance.result12
-rw-r--r--mysql-test/t/ndb_partition_key.test20
8 files changed, 73 insertions, 16 deletions
diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/r/ndb_bitfield.result
index 9a8c571cfba..59c4d420b22 100644
--- a/mysql-test/r/ndb_bitfield.result
+++ b/mysql-test/r/ndb_bitfield.result
@@ -9,7 +9,7 @@ t1 CREATE TABLE `t1` (
`pk1` int(11) NOT NULL,
`b` bit(64) DEFAULT NULL,
PRIMARY KEY (`pk1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
insert into t1 values
(0,b'1111111111111111111111111111111111111111111111111111111111111111'),
(1,b'1000000000000000000000000000000000000000000000000000000000000000'),
diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result
index d5ac5071a8e..99d5dd62717 100644
--- a/mysql-test/r/ndb_dd_basic.result
+++ b/mysql-test/r/ndb_dd_basic.result
@@ -49,7 +49,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1;
pk1 b c
diff --git a/mysql-test/r/ndb_dd_disk2memory.result b/mysql-test/r/ndb_dd_disk2memory.result
index 80056b7269d..bd5bbda42f3 100644
--- a/mysql-test/r/ndb_dd_disk2memory.result
+++ b/mysql-test/r/ndb_dd_disk2memory.result
@@ -218,7 +218,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL,
`c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW CREATE TABLE test.t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
ENGINE=NDB;
SHOW CREATE TABLE test.t2;
@@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL,
`c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`)
-) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
SHOW CREATE TABLE test.t1;
Table Create Table
@@ -245,7 +245,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP TABLE test.t1;
DROP TABLE test.t2;
diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result
index f9b9ceb76a5..67447a69242 100644
--- a/mysql-test/r/ndb_gis.result
+++ b/mysql-test/r/ndb_gis.result
@@ -14,7 +14,7 @@ gis_point CREATE TABLE `gis_point` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` point DEFAULT NULL,
PRIMARY KEY (`fid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW FIELDS FROM gis_point;
Field Type Null Key Default Extra
fid int(11) NO PRI NULL auto_increment
@@ -476,7 +476,7 @@ gis_point CREATE TABLE `gis_point` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` point DEFAULT NULL,
PRIMARY KEY (`fid`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SHOW FIELDS FROM gis_point;
Field Type Null Key Default Extra
fid int(11) NO PRI NULL auto_increment
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result
index 503283df532..b7bf64d8724 100644
--- a/mysql-test/r/ndb_partition_key.result
+++ b/mysql-test/r/ndb_partition_key.result
@@ -137,7 +137,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
alter table t1
partition by key(a)
(partition p0 engine=ndb, partition p1);
@@ -197,3 +197,40 @@ ENGINE=NDB
PARTITION BY KEY(c3);
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
DROP TABLE t1;
+create table t1 (a int) engine = ndb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+alter table t1 add column b int;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+alter table t1 engine = myisam;
+alter table t1 engine = ndb;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
+alter table t1 coalesce partition 1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 1
+drop table t1 ;
+create table t1 (a int) engine = ndb;
+alter table t1 add partition partitions 1;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 3
+drop table t1;
diff --git a/mysql-test/r/rpl_ndb_UUID.result b/mysql-test/r/rpl_ndb_UUID.result
index c768779c49b..422379d4f55 100644
--- a/mysql-test/r/rpl_ndb_UUID.result
+++ b/mysql-test/r/rpl_ndb_UUID.result
@@ -33,7 +33,7 @@ t1 CREATE TABLE `t1` (
`blob_column` longblob,
`vchar_column` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
diff --git a/mysql-test/r/rpl_ndb_dd_advance.result b/mysql-test/r/rpl_ndb_dd_advance.result
index ba89592b532..2cb1cce649b 100644
--- a/mysql-test/r/rpl_ndb_dd_advance.result
+++ b/mysql-test/r/rpl_ndb_dd_advance.result
@@ -69,7 +69,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`,`c3`),
KEY `c5` (`c5`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
**** Show first set of ALTERs on SLAVE ****
SHOW CREATE TABLE t1;
Table Create Table
@@ -82,7 +82,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`,`c3`),
KEY `c5` (`c5`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
**** Second set of alters test 1 ****
ALTER TABLE t1 RENAME t2;
ALTER TABLE t2 DROP INDEX c5;
@@ -101,7 +101,7 @@ t1 CREATE TABLE `t1` (
`c5` double DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
**** Show second set of ALTERs on SLAVE ****
SHOW CREATE TABLE t1;
Table Create Table
@@ -113,7 +113,7 @@ t1 CREATE TABLE `t1` (
`c5` double DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`,`c3`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
**** Third and last set of alters for test1 ****
ALTER TABLE t1 CHANGE c1 c1 DOUBLE;
ALTER TABLE t1 CHANGE c2 c2 DECIMAL(10,2);
@@ -135,7 +135,7 @@ t1 CREATE TABLE `t1` (
`c5` double DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SELECT * FROM t1 ORDER BY c1 LIMIT 5;
c1 c2 c3 c5
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
@@ -153,7 +153,7 @@ t1 CREATE TABLE `t1` (
`c5` double DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `t1_i` (`c2`)
-) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
+) ENGINE=ndbcluster DEFAULT CHARSET=latin1
SELECT * FROM t1 where c1 = 1;
c1 c2 c3 c5
1 2.00 b1b1b1b1b1b1b1b1b1b1 NULL
diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/t/ndb_partition_key.test
index ce939663ab8..9309dc7b36f 100644
--- a/mysql-test/t/ndb_partition_key.test
+++ b/mysql-test/t/ndb_partition_key.test
@@ -196,3 +196,23 @@ CREATE TABLE t1 (
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
DROP TABLE t1;
+
+#
+# BUG 19010: ALTER TABLE from NDB to other engine without primary key
+# doesn't work.
+#
+create table t1 (a int) engine = ndb;
+show create table t1;
+alter table t1 add column b int;
+show create table t1;
+alter table t1 engine = myisam;
+alter table t1 engine = ndb;
+show create table t1;
+alter table t1 coalesce partition 1;
+show create table t1;
+drop table t1 ;
+create table t1 (a int) engine = ndb;
+alter table t1 add partition partitions 1;
+show create table t1;
+drop table t1;
+