mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
f3dc047890
Test case fixes. mysql-test/r/binlog_multi_engine.result: Result change. mysql-test/r/rpl_ndb_stm_innodb.result: Result change. mysql-test/t/binlog_multi_engine.test: NDB tests only work in MIXED or ROW mode. Adding some cleanup actions. mysql-test/t/loaddata_autocom_ndb.test: NDB requires MIXED or ROW mode. mysql-test/t/ndb_alter_table.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_alter_table2.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_alter_table3.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_autodiscover.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_autodiscover2.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_autodiscover3.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_basic.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_binlog_log_bin.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_binlog_multi.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_bitfield.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_blob.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_blob_partition.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_cache.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_cache2.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_cache_multi.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_cache_multi2.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_charset.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_condition_pushdown.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_config.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_config2.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_cursor.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_database.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_alter.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_backuprestore.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_basic.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_ddl.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_disk2memory.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_dump.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_dd_sql_features.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_gis.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_index.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_index_ordered.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_index_unique.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_insert.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_limit.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_loaddatalocal.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_lock.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_minmax.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_multi.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_partition_error.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_partition_key.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_partition_list.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_partition_range.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_read_multi_range.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_rename.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_replace.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_restore.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_restore_partition.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_restore_print.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_row_format.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_single_user.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_sp.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_subquery.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_temporary.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_transaction.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_trigger.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_truncate.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_types.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_update.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndb_view.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ndbapi.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/ps_7ndb.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/rpl_ndb_commit_afterflush.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/rpl_ndb_innodb_trans.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode. mysql-test/t/rpl_ndb_stm_innodb.test: We need MIXED mode on slave since it is necessary to let the slave switch to row format when executing replicated statements. mysql-test/t/strict_autoinc_5ndb.test: NDB requires MIXED or ROW mode, but will switch to row format automatically, so we only run these tests under ROW mode.
230 lines
5.2 KiB
Text
230 lines
5.2 KiB
Text
-- source include/have_ndb.inc
|
|
-- source include/have_binlog_format_row.inc
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Basic syntax test
|
|
#
|
|
|
|
# Support for partition key verified
|
|
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (a,b);
|
|
|
|
insert into t1 values (1,1,1,1);
|
|
select * from t1;
|
|
update t1 set d = 2 where a = 1 and b = 1 and c = 1;
|
|
select * from t1;
|
|
delete from t1;
|
|
select * from t1;
|
|
|
|
drop table t1;
|
|
|
|
# only support for partition key on primary key
|
|
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
|
|
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (c);
|
|
|
|
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (a);
|
|
|
|
insert into t1 values
|
|
(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
|
|
(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
|
|
|
|
select * from t1 order by b;
|
|
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Test partition and char support
|
|
#
|
|
|
|
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
|
|
PRIMARY KEY (a,b,c) USING HASH)
|
|
ENGINE=NDB
|
|
DEFAULT CHARSET=latin1
|
|
PARTITION BY KEY (b);
|
|
|
|
insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
|
|
|
|
# should show only one attribute with DISTRIBUTION KEY
|
|
--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/'
|
|
|
|
#
|
|
# Test that explicit partition info is not shown in show create table
|
|
# result should not contain (PARTITION P0 ... etc) since this is what shows up in
|
|
# mysqldump, and we don't want that info there
|
|
#
|
|
show create table t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Bug #13155: Problem in Create Table using SHOW CREATE TABLE syntax
|
|
#
|
|
CREATE TABLE t1 (a int not null primary key)
|
|
PARTITION BY KEY(a)
|
|
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
|
|
|
|
drop table t1;
|
|
|
|
CREATE TABLE t1 (a int not null primary key);
|
|
ALTER TABLE t1
|
|
PARTITION BY KEY(a)
|
|
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
|
|
|
|
drop table t1;
|
|
|
|
#
|
|
# Bug #17754 Improper handling of removal of partitioning in ALTER TABLE
|
|
# Also added a number of general test cases in the same area
|
|
#
|
|
create table t1 (a int)
|
|
engine=ndb
|
|
partition by key(a)
|
|
(partition p0, partition p1);
|
|
show create table t1;
|
|
|
|
alter table t1 engine=heap;
|
|
show create table t1;
|
|
|
|
alter table t1 engine=ndb;
|
|
show create table t1;
|
|
|
|
alter table t1 engine=heap remove partitioning;
|
|
show create table t1;
|
|
|
|
alter table t1 engine=ndb
|
|
partition by key(a)
|
|
(partition p0, partition p1 engine = ndb);
|
|
show create table t1;
|
|
|
|
alter table t1
|
|
partition by key (a)
|
|
(partition p0 engine=ndb, partition p1 engine=ndb);
|
|
show create table t1;
|
|
|
|
alter table t1 remove partitioning;
|
|
show create table t1;
|
|
|
|
--error ER_MIX_HANDLER_ERROR
|
|
alter table t1
|
|
partition by key(a)
|
|
(partition p0 engine=ndb, partition p1);
|
|
|
|
alter table t1
|
|
engine=ndb
|
|
partition by key(a)
|
|
(partition p0 engine=ndb, partition p1 engine = ndb);
|
|
show create table t1;
|
|
|
|
drop table t1;
|
|
|
|
#
|
|
# BUG 16810 Out of memory when coalesce partition
|
|
#
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
c4 BIT NOT NULL,
|
|
c5 FLOAT,
|
|
c6 VARCHAR(255),
|
|
c7 TIMESTAMP,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3) PARTITIONS 5;
|
|
|
|
let $j= 11;
|
|
--disable_query_log
|
|
while ($j)
|
|
{
|
|
eval INSERT INTO t1 VALUES (NULL, "Tested Remotely from Texas, USA", $j,
|
|
b'0',
|
|
$j.00,"By JBM $j","2006-01-26");
|
|
dec $j;
|
|
}
|
|
--enable_query_log
|
|
ALTER TABLE t1 COALESCE PARTITION 4;
|
|
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Bug 16822: OPTIMIZE TABLE hangs test
|
|
#
|
|
CREATE TABLE t1 (a int primary key)
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(a);
|
|
--error 1031
|
|
ALTER TABLE t1 OPTIMIZE PARTITION p0;
|
|
--error 1031
|
|
ALTER TABLE t1 CHECK PARTITION p0;
|
|
--error 1031
|
|
ALTER TABLE t1 REPAIR PARTITION p0;
|
|
--error 1031
|
|
ALTER TABLE t1 ANALYZE PARTITION p0;
|
|
--error 1031
|
|
ALTER TABLE t1 REBUILD PARTITION p0;
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# BUG 16806: ALTER TABLE fails
|
|
#
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3) PARTITIONS 5;
|
|
|
|
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3)
|
|
(PARTITION p0 NODEGROUP 0, PARTITION p1 NODEGROUP 0);
|
|
|
|
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
|
|
SELECT NODEGROUP,PARTITION_NAME FROM information_schema.partitions WHERE
|
|
table_name = "t1";
|
|
DROP TABLE t1;
|
|
|
|
# bug#25587
|
|
|
|
CREATE TABLE t1 (
|
|
a tinyint unsigned NOT NULL,
|
|
b bigint(20) unsigned NOT NULL,
|
|
c char(12),
|
|
PRIMARY KEY (a,b)
|
|
) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
|
|
|
|
insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
|
|
select * from t1 where a = 1;
|
|
select * from t1 where a = 2;
|
|
select * from t1 where a = 3;
|
|
select * from t1 where a = 4;
|
|
select * from t1 where a = 5;
|
|
delete from t1 where a = 1;
|
|
select * from t1 order by 1;
|
|
delete from t1 where a = 2;
|
|
select * from t1 order by 1;
|
|
delete from t1 where a = 3;
|
|
select * from t1 order by 1;
|
|
delete from t1 where a = 4;
|
|
select * from t1 order by 1;
|
|
delete from t1 where a = 5;
|
|
select * from t1 order by 1;
|
|
|
|
drop table t1;
|