mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
9e14ae9472
into maint1.mysql.com:/data/localhome/tsmith/bk/maint/51 client/mysqldump.c: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/suite/binlog/r/binlog_multi_engine.result: Auto merged mysql-test/suite/binlog/t/binlog_multi_engine.test: Auto merged mysql-test/suite/ndb/r/ndb_read_multi_range.result: Auto merged mysql-test/suite/ndb/r/ndb_sp.result: Auto merged mysql-test/suite/ndb/r/ndb_trigger.result: Auto merged mysql-test/suite/ndb/r/ps_7ndb.result: Auto merged mysql-test/suite/ndb/t/loaddata_autocom_ndb.test: Auto merged mysql-test/suite/ndb/t/ndb_alter_table.test: Auto merged mysql-test/suite/ndb/t/ndb_alter_table2.test: Auto merged mysql-test/suite/ndb/t/ndb_alter_table3.test: Auto merged mysql-test/suite/ndb/t/ndb_autodiscover.test: Auto merged mysql-test/suite/ndb/t/ndb_autodiscover2.test: Auto merged mysql-test/suite/ndb/t/ndb_autodiscover3.test: Auto merged mysql-test/suite/ndb/t/ndb_basic.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_log_bin.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_bitfield.test: Auto merged mysql-test/suite/ndb/t/ndb_blob.test: Auto merged mysql-test/suite/ndb/t/ndb_blob_partition.test: Auto merged mysql-test/suite/ndb/t/ndb_cache.test: Auto merged mysql-test/suite/ndb/t/ndb_cache2.test: Auto merged mysql-test/suite/ndb/t/ndb_cache_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_cache_multi2.test: Auto merged mysql-test/suite/ndb/t/ndb_charset.test: Auto merged mysql-test/suite/ndb/t/ndb_condition_pushdown.test: Auto merged mysql-test/suite/ndb/t/ndb_config.test: Auto merged mysql-test/suite/ndb/t/ndb_config2.test: Auto merged mysql-test/suite/ndb/t/ndb_cursor.test: Auto merged mysql-test/suite/ndb/t/ndb_database.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_alter.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_backuprestore.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_basic.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_ddl.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_disk2memory.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_dump.test: Auto merged mysql-test/suite/ndb/t/ndb_dd_sql_features.test: Auto merged mysql-test/suite/ndb/t/ndb_gis.test: Auto merged mysql-test/suite/ndb/t/ndb_index.test: Auto merged mysql-test/suite/ndb/t/ndb_index_ordered.test: Auto merged mysql-test/suite/ndb/t/ndb_index_unique.test: Auto merged mysql-test/suite/ndb/t/ndb_insert.test: Auto merged mysql-test/suite/ndb/t/ndb_limit.test: Auto merged mysql-test/suite/ndb/t/ndb_loaddatalocal.test: Auto merged mysql-test/suite/ndb/t/ndb_lock.test: Auto merged mysql-test/suite/ndb/t/ndb_minmax.test: Auto merged mysql-test/suite/ndb/t/ndb_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_partition_error.test: Auto merged mysql-test/suite/ndb/t/ndb_partition_key.test: Auto merged mysql-test/suite/ndb/t/ndb_partition_list.test: Auto merged mysql-test/suite/ndb/t/ndb_partition_range.test: Auto merged mysql-test/suite/ndb/t/ndb_read_multi_range.test: Auto merged mysql-test/suite/ndb/t/ndb_rename.test: Auto merged mysql-test/suite/ndb/t/ndb_replace.test: Auto merged mysql-test/suite/ndb/t/ndb_restore.test: Auto merged mysql-test/suite/ndb/t/ndb_restore_partition.test: Auto merged mysql-test/suite/ndb/t/ndb_restore_print.test: Auto merged mysql-test/suite/ndb/t/ndb_row_format.test: Auto merged mysql-test/suite/ndb/t/ndb_single_user.test: Auto merged mysql-test/suite/ndb/t/ndb_sp.test: Auto merged mysql-test/suite/ndb/t/ndb_subquery.test: Auto merged mysql-test/suite/ndb/t/ndb_temporary.test: Auto merged mysql-test/suite/ndb/t/ndb_transaction.test: Auto merged mysql-test/suite/ndb/t/ndb_trigger.test: Auto merged mysql-test/suite/ndb/t/ndb_truncate.test: Auto merged mysql-test/suite/ndb/t/ndb_types.test: Auto merged mysql-test/suite/ndb/t/ndb_update.test: Auto merged mysql-test/suite/ndb/t/ndb_view.test: Auto merged mysql-test/suite/ndb/t/ndbapi.test: Auto merged mysql-test/suite/ndb/t/ps_7ndb.test: Auto merged mysql-test/suite/ndb/t/strict_autoinc_5ndb.test: Auto merged mysql-test/suite/rpl/r/rpl_events.result: Auto merged mysql-test/suite/rpl/r/rpl_replicate_do.result: Auto merged mysql-test/suite/rpl/r/rpl_row_UUID.result: Auto merged mysql-test/suite/rpl/r/rpl_sp.result: Auto merged mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: Auto merged mysql-test/suite/rpl/r/rpl_trigger.result: Auto merged mysql-test/suite/rpl/r/rpl_view.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test: Auto merged mysql-test/t/sp.test: Auto merged sql/Makefile.am: Auto merged sql/mysql_priv.h: Auto merged sql/sql_class.h: Auto merged mysql-test/t/disabled.def: manual merge (Will need to follow up with moving a few test cases around post-merge)
264 lines
6.1 KiB
Text
264 lines
6.1 KiB
Text
-- source include/have_ndb.inc
|
|
#--disable_abort_on_error
|
|
#
|
|
# Simple test for the partition storage engine
|
|
# Focuses on range partitioning tests
|
|
#
|
|
#-- source include/have_partition.inc
|
|
|
|
--disable_query_log
|
|
set new=on;
|
|
--enable_query_log
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Partition by range, basic
|
|
#
|
|
CREATE TABLE t1 (
|
|
a int not null,
|
|
b int not null,
|
|
c int not null,
|
|
primary key(a,b),
|
|
index (a))
|
|
engine = ndb
|
|
partition by range (a)
|
|
partitions 3
|
|
(partition x1 values less than (5),
|
|
partition x2 values less than (10),
|
|
partition x3 values less than (20));
|
|
|
|
# Simple insert and verify test
|
|
INSERT into t1 values (1, 1, 1);
|
|
INSERT into t1 values (6, 1, 1);
|
|
INSERT into t1 values (10, 1, 1);
|
|
INSERT into t1 values (15, 1, 1);
|
|
|
|
--replace_column 16 # 19 # 20 #
|
|
select * from information_schema.partitions where table_name= 't1';
|
|
|
|
select * from t1 order by a;
|
|
|
|
select * from t1 where a=1 order by a;
|
|
select * from t1 where a=15 and b=1 order by a;
|
|
select * from t1 where a=21 and b=1 order by a;
|
|
select * from t1 where a=21 order by a;
|
|
select * from t1 where a in (1,6,10,21) order by a;
|
|
select * from t1 where b=1 and a in (1,6,10,21) order by a;
|
|
|
|
drop table t1;
|
|
|
|
#
|
|
# Partition by range, basic
|
|
#
|
|
CREATE TABLE t1 (
|
|
a int not null,
|
|
b int not null,
|
|
c int not null,
|
|
primary key(b),
|
|
unique (a))
|
|
engine = ndb
|
|
partition by range (b)
|
|
partitions 3
|
|
(partition x1 values less than (5),
|
|
partition x2 values less than (10),
|
|
partition x3 values less than (20));
|
|
|
|
# Simple insert and verify test
|
|
INSERT into t1 values (1, 1, 1);
|
|
INSERT into t1 values (2, 6, 1);
|
|
INSERT into t1 values (3, 10, 1);
|
|
INSERT into t1 values (4, 15, 1);
|
|
|
|
select * from t1 order by a;
|
|
UPDATE t1 set a = 5 WHERE b = 15;
|
|
select * from t1 order by a;
|
|
UPDATE t1 set a = 6 WHERE a = 5;
|
|
select * from t1 order by a;
|
|
|
|
select * from t1 where b=1 order by b;
|
|
select * from t1 where b=15 and a=1 order by b;
|
|
select * from t1 where b=21 and a=1 order by b;
|
|
select * from t1 where b=21 order by b;
|
|
select * from t1 where b in (1,6,10,21) order by b;
|
|
select * from t1 where a in (1,2,5,6) order by b;
|
|
select * from t1 where a=1 and b in (1,6,10,21) order by b;
|
|
|
|
DELETE from t1 WHERE b = 6;
|
|
DELETE from t1 WHERE a = 6;
|
|
|
|
#
|
|
# Test that explicit partition info _is_ shown in show create table
|
|
# result _should_ contain (PARTITION x1 ... etc)
|
|
#
|
|
show create table t1;
|
|
|
|
drop table t1;
|
|
|
|
#
|
|
# Bug #17499, #17687
|
|
# Alter partitioned NDB table causes mysqld to core
|
|
#
|
|
|
|
CREATE TABLE t1
|
|
(id MEDIUMINT NOT NULL,
|
|
b1 BIT(8),
|
|
vc VARCHAR(255),
|
|
bc CHAR(255),
|
|
d DECIMAL(10,4) DEFAULT 0,
|
|
f FLOAT DEFAULT 0,
|
|
total BIGINT UNSIGNED,
|
|
y YEAR,
|
|
t DATE) ENGINE=NDB
|
|
PARTITION BY RANGE (YEAR(t))
|
|
(PARTITION p0 VALUES LESS THAN (1901),
|
|
PARTITION p1 VALUES LESS THAN (1946),
|
|
PARTITION p2 VALUES LESS THAN (1966),
|
|
PARTITION p3 VALUES LESS THAN (1986),
|
|
PARTITION p4 VALUES LESS THAN (2005),
|
|
PARTITION p5 VALUES LESS THAN MAXVALUE);
|
|
|
|
INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
|
SELECT * FROM t1;
|
|
ALTER TABLE t1 ENGINE=MYISAM;
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
|
|
CREATE LOGFILE GROUP lg1
|
|
ADD UNDOFILE 'undofile.dat'
|
|
INITIAL_SIZE 16M
|
|
UNDO_BUFFER_SIZE=1M
|
|
ENGINE=NDB;
|
|
|
|
CREATE TABLESPACE ts1
|
|
ADD DATAFILE 'datafile.dat'
|
|
USE LOGFILE GROUP lg1
|
|
INITIAL_SIZE 12M
|
|
ENGINE NDB;
|
|
|
|
CREATE TABLE test.t1 (
|
|
a1 INT,
|
|
a2 TEXT NOT NULL,
|
|
a3 BIT NOT NULL,
|
|
a4 DECIMAL(8,3),
|
|
a5 INT NOT NULL,
|
|
a6 INT,
|
|
PRIMARY KEY(a1))
|
|
TABLESPACE ts1 STORAGE DISK ENGINE=NDB
|
|
PARTITION BY LIST (a1)
|
|
(PARTITION p0 VALUES IN (1,2,3,4,5),
|
|
PARTITION p1 VALUES IN (6,7,8,9, 10),
|
|
PARTITION p2 VALUES IN (11, 12, 13, 14, 15));
|
|
|
|
# Alter table directly without any statements inbetween
|
|
ALTER TABLE test.t1 DROP COLUMN a6;
|
|
ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255);
|
|
|
|
let $j= 15;
|
|
--disable_query_log
|
|
while ($j)
|
|
{
|
|
eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
|
|
b'1',$j.00,$j+1,"By NIK $j");
|
|
dec $j;
|
|
}
|
|
--enable_query_log
|
|
SELECT COUNT(*) FROM test.t1;
|
|
|
|
ALTER TABLE test.t1 DROP COLUMN a4;
|
|
SELECT COUNT(*) FROM test.t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE test.t1 (
|
|
a1 INT,
|
|
a2 TEXT NOT NULL,
|
|
a3 BIT NOT NULL,
|
|
a4 DECIMAL(8,3),
|
|
a5 INT NOT NULL,
|
|
a6 VARCHAR(255),
|
|
PRIMARY KEY(a1))
|
|
TABLESPACE ts1 STORAGE DISK ENGINE=NDB
|
|
PARTITION BY HASH(a1)
|
|
PARTITIONS 4;
|
|
|
|
let $j= 15;
|
|
--disable_query_log
|
|
while ($j)
|
|
{
|
|
eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA",
|
|
b'1',$j.00,$j+1,"By NIK $j");
|
|
dec $j;
|
|
}
|
|
--enable_query_log
|
|
SELECT COUNT(*) FROM test.t1;
|
|
|
|
ALTER TABLE test.t1 DROP COLUMN a4;
|
|
SELECT COUNT(*) FROM test.t1;
|
|
|
|
DROP TABLE t1;
|
|
|
|
ALTER TABLESPACE ts1
|
|
DROP DATAFILE 'datafile.dat'
|
|
ENGINE=NDB;
|
|
DROP TABLESPACE ts1 ENGINE=NDB;
|
|
DROP LOGFILE GROUP lg1 ENGINE=NDB;
|
|
|
|
|
|
#
|
|
# Bug #17701 ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test
|
|
#
|
|
|
|
CREATE TABLE t1
|
|
(id MEDIUMINT NOT NULL,
|
|
b1 BIT(8),
|
|
vc VARCHAR(255),
|
|
bc CHAR(255),
|
|
d DECIMAL(10,4) DEFAULT 0,
|
|
f FLOAT DEFAULT 0,
|
|
total BIGINT UNSIGNED,
|
|
y YEAR,
|
|
t DATE) ENGINE=NDB
|
|
PARTITION BY LIST(id)
|
|
(PARTITION p0 VALUES IN (2, 4),
|
|
PARTITION p1 VALUES IN (42, 142));
|
|
|
|
INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
|
SELECT * FROM t1;
|
|
ALTER TABLE t1 ADD PARTITION
|
|
(PARTITION p2 VALUES IN (412));
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
|
|
#
|
|
# Bug #17806 Update on NDB table with list partition causes mysqld to core
|
|
# Bug #16385 Partitions: crash when updating a range partitioned NDB table
|
|
#
|
|
CREATE TABLE t1 (
|
|
a int not null,
|
|
b int not null,
|
|
c int not null)
|
|
partition by list(a)
|
|
partitions 2
|
|
(partition x123 values in (1,5,6),
|
|
partition x234 values in (4,7,8));
|
|
INSERT into t1 VALUES (5,1,1);
|
|
select * from t1;
|
|
UPDATE t1 SET a=8 WHERE a=5 AND b=1;
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb
|
|
PARTITION BY RANGE(f1)
|
|
( PARTITION part1 VALUES LESS THAN (2),
|
|
PARTITION part2 VALUES LESS THAN (1000));
|
|
INSERT INTO t1 VALUES(1, '---1---');
|
|
INSERT INTO t1 VALUES(2, '---2---');
|
|
select * from t1 order by f1;
|
|
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2;
|
|
select * from t1 order by f1;
|
|
UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1;
|
|
select * from t1 order by f1;
|
|
drop table t1;
|