mirror of
https://github.com/MariaDB/server.git
synced 2025-11-12 10:22:39 +03:00
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1
This commit is contained in:
@@ -13,20 +13,20 @@ CREATE TABLE t2 (p POINT, INDEX(p));
|
||||
INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
|
||||
INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
|
||||
|
||||
-- no index, returns 1 as expected
|
||||
# no index, returns 1 as expected
|
||||
SELECT COUNT(*) FROM t1 WHERE p=POINTFROMTEXT('POINT(1 2)');
|
||||
|
||||
-- with index, returns 1 as expected
|
||||
-- EXPLAIN shows that the index is not used though
|
||||
-- due to the "most rows covered anyway, so a scan is more effective" rule
|
||||
# with index, returns 1 as expected
|
||||
# EXPLAIN shows that the index is not used though
|
||||
# due to the "most rows covered anyway, so a scan is more effective" rule
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
|
||||
SELECT COUNT(*) FROM t2 WHERE p=POINTFROMTEXT('POINT(1 2)');
|
||||
|
||||
-- adding another row to the table so that
|
||||
-- the "most rows covered" rule doesn't kick in anymore
|
||||
-- now EXPLAIN shows the index used on the table
|
||||
-- and we're getting the wrong result again
|
||||
# adding another row to the table so that
|
||||
# the "most rows covered" rule doesn't kick in anymore
|
||||
# now EXPLAIN shows the index used on the table
|
||||
# and we're getting the wrong result again
|
||||
INSERT INTO t1 VALUES (POINTFROMTEXT('POINT(1 2)'));
|
||||
INSERT INTO t2 VALUES (POINTFROMTEXT('POINT(1 2)'));
|
||||
EXPLAIN
|
||||
|
||||
@@ -1212,7 +1212,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
|
||||
ENGINE = $engine_type;
|
||||
INSERT INTO t1 VALUES (1,2);
|
||||
|
||||
--#echo 1. test for locking:
|
||||
--echo # 1. test for locking:
|
||||
|
||||
BEGIN;
|
||||
--enable_info
|
||||
|
||||
@@ -3754,7 +3754,9 @@ sub mysqld_arguments ($$$$) {
|
||||
# When mysqld is run by a root user(euid is 0), it will fail
|
||||
# to start unless we specify what user to run as. If not running
|
||||
# as root it will be ignored, see BUG#30630
|
||||
if (!(grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt))) {
|
||||
my $euid= $>;
|
||||
if (!$glob_win32 and $euid == 0 and
|
||||
grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt) == 0) {
|
||||
mtr_add_arg($args, "%s--user=root");
|
||||
}
|
||||
|
||||
|
||||
@@ -811,6 +811,12 @@ quote(name)
|
||||
????????
|
||||
????????????????
|
||||
drop table bug20536;
|
||||
CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
|
||||
INSERT INTO t1 VALUES('abcd');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
|
||||
a
|
||||
abcd
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
||||
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
||||
|
||||
@@ -253,6 +253,14 @@ drop user guest_usage@localhost;
|
||||
drop user guest_select@localhost;
|
||||
drop table federated.t1;
|
||||
drop server 's1';
|
||||
create server 's1' foreign data wrapper 'mysql' options (port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database '', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database 'database1', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
drop server 's1';
|
||||
# End of 5.1 tests
|
||||
use test;
|
||||
create procedure p1 ()
|
||||
@@ -262,7 +270,7 @@ DECLARE e INT DEFAULT 0;
|
||||
DECLARE i INT;
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
|
||||
SET i = sleep(5);
|
||||
WHILE v < 20000 do
|
||||
WHILE v < 10000 do
|
||||
CREATE SERVER s
|
||||
FOREIGN DATA WRAPPER mysql
|
||||
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
|
||||
|
||||
@@ -476,6 +476,12 @@ ALTER TABLE t1 DISABLE KEYS;
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
|
||||
ERROR HY000: Can't find FULLTEXT index matching the column list
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a TEXT);
|
||||
INSERT INTO t1 VALUES(' aaaaa aaaa');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
|
||||
a
|
||||
aaaaa aaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a));
|
||||
INSERT INTO t1 VALUES('Offside'),('City Of God');
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE);
|
||||
|
||||
@@ -1460,6 +1460,7 @@ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
|
||||
ENGINE = InnoDB;
|
||||
INSERT INTO t1 VALUES (1,2);
|
||||
# 1. test for locking:
|
||||
BEGIN;
|
||||
UPDATE t1 SET b = 12 WHERE a = 1;
|
||||
affected rows: 1
|
||||
|
||||
@@ -1794,6 +1794,31 @@ SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
|
||||
a
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 0 # # # 1024 # # # # # # #
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
|
||||
ALTER TABLE t1 DISABLE KEYS;
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
|
||||
ALTER TABLE t1 DISABLE KEYS;
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 MyISAM 10 Fixed 1 # # # 3072 # # # # # # #
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||
show create table t1;
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (
|
||||
d DATE NOT NULL
|
||||
)
|
||||
PARTITION BY RANGE( YEAR(d) ) (
|
||||
PARTITION p0 VALUES LESS THAN (1960),
|
||||
PARTITION p1 VALUES LESS THAN (1970),
|
||||
PARTITION p2 VALUES LESS THAN (1980),
|
||||
PARTITION p3 VALUES LESS THAN (1990)
|
||||
);
|
||||
ALTER TABLE t1 ADD PARTITION (
|
||||
PARTITION `p5` VALUES LESS THAN (2010)
|
||||
COMMENT 'APSTART \' APEND'
|
||||
);
|
||||
SELECT * FROM t1 LIMIT 1;
|
||||
d
|
||||
DROP TABLE t1;
|
||||
create table t1 (id int auto_increment, s1 int, primary key (id));
|
||||
insert into t1 values (null,1);
|
||||
insert into t1 values (null,6);
|
||||
select * from t1;
|
||||
id s1
|
||||
1 1
|
||||
2 6
|
||||
alter table t1 partition by range (id) (
|
||||
partition p0 values less than (3),
|
||||
partition p1 values less than maxvalue
|
||||
);
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
partitions 0.2+e1;
|
||||
@@ -687,7 +715,7 @@ partition by range (a)
|
||||
alter table t1 add partition (partition p1 values in (2));
|
||||
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
|
||||
alter table t1 add partition (partition p1);
|
||||
ERROR HY000: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
|
||||
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
@@ -695,7 +723,7 @@ partition by list (a)
|
||||
alter table t1 add partition (partition p1 values less than (2));
|
||||
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
|
||||
alter table t1 add partition (partition p1);
|
||||
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by hash (a)
|
||||
|
||||
282
mysql-test/r/partition_datatype.result
Normal file
282
mysql-test/r/partition_datatype.result
Normal file
@@ -0,0 +1,282 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (a tinyint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a smallint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a mediumint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a int not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a bigint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a float not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a double not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
2.1
|
||||
drop table t1;
|
||||
create table t1 (a decimal not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a date not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01');
|
||||
select * from t1 where a = '2001-01-01';
|
||||
a
|
||||
2001-01-01
|
||||
drop table t1;
|
||||
create table t1 (a datetime not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
a
|
||||
2001-01-01 01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a timestamp not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
a
|
||||
2001-01-01 01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a time not null) partition by key (a);
|
||||
insert into t1 values ('01:02:03');
|
||||
select * from t1 where a = '01:02:03';
|
||||
a
|
||||
01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a year not null) partition by key (a);
|
||||
insert into t1 values ('2001');
|
||||
select * from t1 where a = '2001';
|
||||
a
|
||||
2001
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a enum('y','n') not null) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
a
|
||||
y
|
||||
drop table t1;
|
||||
create table t1 (a set('y','n') not null) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
a
|
||||
y
|
||||
drop table t1;
|
||||
create table t1 (a tinyint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a smallint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a mediumint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a int) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a bigint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
a
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (a float) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a double) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
2.1
|
||||
drop table t1;
|
||||
create table t1 (a decimal) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1 where a = 2.1;
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a date) partition by key (a);
|
||||
insert into t1 values ('2001-01-01');
|
||||
select * from t1 where a = '2001-01-01';
|
||||
a
|
||||
2001-01-01
|
||||
drop table t1;
|
||||
create table t1 (a datetime) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
a
|
||||
2001-01-01 01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a timestamp null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
a
|
||||
2001-01-01 01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a time) partition by key (a);
|
||||
insert into t1 values ('01:02:03');
|
||||
select * from t1 where a = '01:02:03';
|
||||
a
|
||||
01:02:03
|
||||
drop table t1;
|
||||
create table t1 (a year) partition by key (a);
|
||||
insert into t1 values ('2001');
|
||||
select * from t1 where a = '2001';
|
||||
a
|
||||
2001
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
a
|
||||
abc
|
||||
drop table t1;
|
||||
create table t1 (a enum('y','n')) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
a
|
||||
y
|
||||
drop table t1;
|
||||
create table t1 (a set('y','n')) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
a
|
||||
y
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65531)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
a
|
||||
select * from t1 where a like 'aaa%';
|
||||
a
|
||||
aaaa
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65532)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
a
|
||||
select * from t1 where a like 'aaa%';
|
||||
a
|
||||
aaaa
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65533) not null) partition by key (a);
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65533)) partition by key (a);
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
create table t1 (a varchar(65534) not null) partition by key (a);
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
create table t1 (a varchar(65535)) partition by key (a);
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
@@ -1,4 +1,13 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (
|
||||
a int
|
||||
)
|
||||
PARTITION BY RANGE (a)
|
||||
(
|
||||
PARTITION p0 VALUES LESS THAN (1),
|
||||
PARTITION p1 VALU ES LESS THAN (2)
|
||||
);
|
||||
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
|
||||
partition by list (a)
|
||||
partitions 3
|
||||
(partition x1 values in (1,2,9,4) tablespace ts1,
|
||||
@@ -351,7 +360,7 @@ partition by range (a)
|
||||
partitions 2
|
||||
(partition x1 values less than (4),
|
||||
partition x2);
|
||||
ERROR HY000: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
|
||||
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@@ -531,7 +540,7 @@ partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4),
|
||||
partition x2);
|
||||
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@@ -551,7 +560,7 @@ partition by list (a)
|
||||
partitions 2
|
||||
(partition x1 values in (4,6),
|
||||
partition x2);
|
||||
ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
||||
@@ -183,3 +183,6 @@ c1 c2 c3
|
||||
182 abc 2002-11-09
|
||||
184 abc 2002-11-22
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (c1 INT) ENGINE=MyISAM PARTITION BY HASH(c1) PARTITIONS 1;
|
||||
INSERT DELAYED INTO t1 VALUES (1);
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -17,12 +17,6 @@ t1 CREATE TABLE `t1` (
|
||||
`f_date` date DEFAULT NULL,
|
||||
`f_varchar` varchar(30) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */
|
||||
hello/master-data/test/t1#P#p0.MYD
|
||||
hello/master-data/test/t1#P#p0.MYI
|
||||
hello/master-data/test/t1#P#p1.MYD
|
||||
hello/master-data/test/t1#P#p1.MYI
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
@@ -30,10 +24,6 @@ t1 CREATE TABLE `t1` (
|
||||
`f_date` date DEFAULT NULL,
|
||||
`f_varchar` varchar(30) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */
|
||||
hello/master-data/test/t1#P#p0.MYD
|
||||
hello/master-data/test/t1#P#p0.MYI
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
|
||||
83
mysql-test/r/partition_symlink.result
Normal file
83
mysql-test/r/partition_symlink.result
Normal file
@@ -0,0 +1,83 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
# Creating two non colliding tables mysqltest2.t1 and test.t1
|
||||
# test.t1 have partitions in mysqltest2-directory!
|
||||
# user root:
|
||||
CREATE USER mysqltest_1@localhost;
|
||||
CREATE DATABASE mysqltest2;
|
||||
USE mysqltest2;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (0);
|
||||
# user mysqltest_1:
|
||||
USE test;
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/test',
|
||||
PARTITION p2 VALUES IN (2)
|
||||
);
|
||||
# without the patch for bug#32091 this would create
|
||||
# files mysqltest2/t1.MYD + .MYI and possible overwrite
|
||||
# the mysqltest2.t1 table (depending on bug#32111)
|
||||
ALTER TABLE t1 REMOVE PARTITIONING;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
# user root:
|
||||
USE mysqltest2;
|
||||
FLUSH TABLES;
|
||||
# if the patch works, this should be different
|
||||
# and before the patch they were the same!
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
0
|
||||
USE test;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE mysqltest2;
|
||||
# test that symlinks can not overwrite files when CREATE TABLE
|
||||
# user root:
|
||||
CREATE DATABASE mysqltest2;
|
||||
USE mysqltest2;
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
);
|
||||
# user mysqltest_1:
|
||||
USE test;
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
);
|
||||
Got one of the listed errors
|
||||
CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/test',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY 'MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
);
|
||||
Got one of the listed errors
|
||||
# user root (cleanup):
|
||||
DROP DATABASE mysqltest2;
|
||||
USE test;
|
||||
DROP USER mysqltest_1@localhost;
|
||||
@@ -99,6 +99,12 @@ t1 CREATE TABLE `t1` (
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='TEST_DIR/master-data/mysql'
|
||||
INDEX DIRECTORY='TEST_DIR/master-data/mysql';
|
||||
RENAME TABLE t1 TO user;
|
||||
ERROR HY000: Can't create/write to file 'TEST_DIR/master-data/mysql/user.MYI' (Errcode: 17)
|
||||
DROP TABLE t1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
||||
@@ -547,6 +547,14 @@ select quote(name) from bug20536;
|
||||
|
||||
drop table bug20536;
|
||||
|
||||
#
|
||||
# BUG#31159 - fulltext search on ucs2 column crashes server
|
||||
#
|
||||
CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
|
||||
INSERT INTO t1 VALUES('abcd');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 4.1 tests
|
||||
|
||||
#
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# if federated can utilise the servers table
|
||||
# should work with embedded server after mysqltest is fixed
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/federated.inc;
|
||||
-- source include/federated.inc
|
||||
-- source include/big_test.inc
|
||||
|
||||
connection slave;
|
||||
@@ -282,6 +282,18 @@ drop user guest_select@localhost;
|
||||
drop table federated.t1;
|
||||
drop server 's1';
|
||||
|
||||
#
|
||||
# Bug#30671 - ALTER SERVER causes the server to crash
|
||||
#
|
||||
create server 's1' foreign data wrapper 'mysql' options (port 3306);
|
||||
alter server 's1' options
|
||||
(host 'localhost', database '', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
# The next statement would crash unpatched server
|
||||
alter server 's1' options
|
||||
(host 'localhost', database 'database1', user '',
|
||||
password '', socket '', owner '', port 3306);
|
||||
drop server 's1';
|
||||
|
||||
--echo # End of 5.1 tests
|
||||
|
||||
|
||||
@@ -399,6 +399,14 @@ ALTER TABLE t1 DISABLE KEYS;
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#11392 - fulltext search bug
|
||||
#
|
||||
CREATE TABLE t1(a TEXT);
|
||||
INSERT INTO t1 VALUES(' aaaaa aaaa');
|
||||
SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#29445 - match ... against () never returns
|
||||
#
|
||||
|
||||
@@ -1146,6 +1146,32 @@ ALTER TABLE t1 ENABLE KEYS;
|
||||
SELECT a FROM t1 FORCE INDEX (inx) WHERE a=1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#4692 - DISABLE/ENABLE KEYS waste a space
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
ALTER TABLE t1 DISABLE KEYS;
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
ALTER TABLE t1 DISABLE KEYS;
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
ALTER TABLE t1 ENABLE KEYS;
|
||||
--replace_column 6 # 7 # 8 # 10 # 11 # 12 # 13 # 14 # 15 # 16 #
|
||||
SHOW TABLE STATUS LIKE 't1';
|
||||
#--exec ls -log var/master-data/test/t1.MYI
|
||||
#--exec myisamchk -dvv var/master-data/test/t1.MYI
|
||||
#--exec myisamchk -iev var/master-data/test/t1.MYI
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
@@ -1256,3 +1282,4 @@ CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
|
||||
@@ -14,6 +14,50 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes the Server to crash.
|
||||
#
|
||||
# To verify the fix for crashing (on unix-type OS)
|
||||
# uncomment the exec and error rows!
|
||||
|
||||
CREATE TABLE t1 (
|
||||
d DATE NOT NULL
|
||||
)
|
||||
PARTITION BY RANGE( YEAR(d) ) (
|
||||
PARTITION p0 VALUES LESS THAN (1960),
|
||||
PARTITION p1 VALUES LESS THAN (1970),
|
||||
PARTITION p2 VALUES LESS THAN (1980),
|
||||
PARTITION p3 VALUES LESS THAN (1990)
|
||||
);
|
||||
|
||||
ALTER TABLE t1 ADD PARTITION (
|
||||
PARTITION `p5` VALUES LESS THAN (2010)
|
||||
COMMENT 'APSTART \' APEND'
|
||||
);
|
||||
#--exec sed 's/APSTART \\/APSTART /' var/master-data/test/t1.frm > tmpt1.frm && mv tmpt1.frm var/master-data/test/t1.frm
|
||||
#--error 1064
|
||||
SELECT * FROM t1 LIMIT 1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug 30878: crashing when alter an auto_increment non partitioned
|
||||
# table to partitioned
|
||||
|
||||
create table t1 (id int auto_increment, s1 int, primary key (id));
|
||||
|
||||
insert into t1 values (null,1);
|
||||
insert into t1 values (null,6);
|
||||
|
||||
select * from t1;
|
||||
|
||||
alter table t1 partition by range (id) (
|
||||
partition p0 values less than (3),
|
||||
partition p1 values less than maxvalue
|
||||
);
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug 15890: Strange number of partitions accepted
|
||||
#
|
||||
|
||||
213
mysql-test/t/partition_datatype.test
Normal file
213
mysql-test/t/partition_datatype.test
Normal file
@@ -0,0 +1,213 @@
|
||||
#
|
||||
# Simple test for the partition storage engine
|
||||
# with most datatypes and null / not null
|
||||
# as partition by key
|
||||
# Created to verify the fix for Bug#31705
|
||||
# Partitions: crash if varchar length > 65530
|
||||
#
|
||||
-- source include/have_partition.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# FIXME: disabled this test because of valgrind error
|
||||
#create table t1 (a bit not null) partition by key (a);
|
||||
#insert into t1 values (b'1');
|
||||
#select * from t1 where a = b'1';
|
||||
#drop table t1;
|
||||
create table t1 (a tinyint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a smallint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a mediumint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a int not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a bigint not null) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a float not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a double not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a decimal not null) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a date not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01');
|
||||
select * from t1 where a = '2001-01-01';
|
||||
drop table t1;
|
||||
create table t1 (a datetime not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a timestamp not null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a time not null) partition by key (a);
|
||||
insert into t1 values ('01:02:03');
|
||||
select * from t1 where a = '01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a year not null) partition by key (a);
|
||||
insert into t1 values ('2001');
|
||||
select * from t1 where a = '2001';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set utf8 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set latin1 not null) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a enum('y','n') not null) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
drop table t1;
|
||||
create table t1 (a set('y','n') not null) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
drop table t1;
|
||||
# FIXME: disabled this test because of valgrind error
|
||||
#create table t1 (a bit) partition by key (a);
|
||||
#insert into t1 values (b'1');
|
||||
#select * from t1 where a = b'1';
|
||||
#drop table t1;
|
||||
create table t1 (a tinyint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a smallint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a mediumint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a int) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a bigint) partition by key (a);
|
||||
insert into t1 values (2);
|
||||
select * from t1 where a = 2;
|
||||
drop table t1;
|
||||
create table t1 (a float) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a double) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a decimal) partition by key (a);
|
||||
insert into t1 values (2.1);
|
||||
select * from t1 where a = 2.1;
|
||||
drop table t1;
|
||||
create table t1 (a date) partition by key (a);
|
||||
insert into t1 values ('2001-01-01');
|
||||
select * from t1 where a = '2001-01-01';
|
||||
drop table t1;
|
||||
create table t1 (a datetime) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a timestamp null) partition by key (a);
|
||||
insert into t1 values ('2001-01-01 01:02:03');
|
||||
select * from t1 where a = '2001-01-01 01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a time) partition by key (a);
|
||||
insert into t1 values ('01:02:03');
|
||||
select * from t1 where a = '01:02:03';
|
||||
drop table t1;
|
||||
create table t1 (a year) partition by key (a);
|
||||
insert into t1 values ('2001');
|
||||
select * from t1 where a = '2001';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(300) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set utf8) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a char(10) character set latin1) partition by key (a);
|
||||
insert into t1 values ('abc');
|
||||
select * from t1 where a = 'abc';
|
||||
drop table t1;
|
||||
create table t1 (a enum('y','n')) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
drop table t1;
|
||||
create table t1 (a set('y','n')) partition by key (a);
|
||||
insert into t1 values ('y');
|
||||
select * from t1 where a = 'y';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65531)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
select * from t1 where a like 'aaa%';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65532)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
select * from t1 where a like 'aaa%';
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65533) not null) partition by key (a);
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaa%';
|
||||
drop table t1;
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create table t1 (a varchar(65533)) partition by key (a);
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create table t1 (a varchar(65534) not null) partition by key (a);
|
||||
-- error ER_TOO_BIG_ROWSIZE
|
||||
create table t1 (a varchar(65535)) partition by key (a);
|
||||
@@ -8,6 +8,19 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug 29368:
|
||||
# Incorrect error, 1467, for syntax error when creating partition
|
||||
--error ER_PARTITION_REQUIRES_VALUES_ERROR
|
||||
CREATE TABLE t1 (
|
||||
a int
|
||||
)
|
||||
PARTITION BY RANGE (a)
|
||||
(
|
||||
PARTITION p0 VALUES LESS THAN (1),
|
||||
PARTITION p1 VALU ES LESS THAN (2)
|
||||
);
|
||||
|
||||
#
|
||||
# Partition by key stand-alone error
|
||||
#
|
||||
|
||||
@@ -144,3 +144,13 @@ select * from t1 where c3 between '2002-01-01' and '2002-12-31';
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#31210 - INSERT DELAYED crashes server when used on partitioned table
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT) ENGINE=MyISAM PARTITION BY HASH(c1) PARTITIONS 1;
|
||||
# The test succeeds in an embedded server because normal insert is done.
|
||||
# The test fails in a normal server with "engine doesn't have this option".
|
||||
--error 0, ER_ILLEGAL_HA
|
||||
INSERT DELAYED INTO t1 VALUES (1);
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
@@ -22,17 +22,18 @@ drop table t1;
|
||||
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
|
||||
PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR "hello"
|
||||
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1#*
|
||||
--replace_result $MYSQLTEST_VARDIR "hello"
|
||||
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1.*
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
|
||||
ALTER TABLE t1 COALESCE PARTITION 1;
|
||||
SHOW CREATE TABLE t1;
|
||||
--replace_result $MYSQLTEST_VARDIR "hello"
|
||||
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1#*
|
||||
--replace_result $MYSQLTEST_VARDIR "hello"
|
||||
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1.*
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
|
||||
-- file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
|
||||
drop table t1;
|
||||
#
|
||||
# Bug 20767: REORGANIZE partition crashes
|
||||
|
||||
121
mysql-test/t/partition_symlink.test
Normal file
121
mysql-test/t/partition_symlink.test
Normal file
@@ -0,0 +1,121 @@
|
||||
# Test that must have symlink. eg. using DATA/INDEX DIR
|
||||
# (DATA/INDEX DIR requires symlinks)
|
||||
-- source include/have_partition.inc
|
||||
-- source include/have_symlink.inc
|
||||
# remove the not_windows line after fixing bug#30459
|
||||
-- source include/not_windows.inc
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
-- enable_warnings
|
||||
|
||||
#
|
||||
# Bug 32091: Security breach via directory changes
|
||||
#
|
||||
# The below test shows that a pre-existing table mysqltest2.t1 cannot be
|
||||
# replaced by a user with no rights in 'mysqltest2'. The altered table
|
||||
# test.t1 will be altered (remove partitioning) into the test directory
|
||||
# and having its partitions removed from the mysqltest2 directory.
|
||||
# (the partitions data files are named <tablename>#P#<partname>.MYD
|
||||
# and will not collide with a non partitioned table's data files.)
|
||||
# NOTE: the privileges on files and directories are the same for all
|
||||
# database users in mysqld, though mysqld enforces privileges on
|
||||
# the database and table levels which in turn maps to directories and
|
||||
# files, but not the other way around (any db-user can use any
|
||||
# directory or file that the mysqld-process can use, via DATA/INDEX DIR)
|
||||
# this is the security flaw that was used in bug#32091 and bug#32111
|
||||
-- echo # Creating two non colliding tables mysqltest2.t1 and test.t1
|
||||
-- echo # test.t1 have partitions in mysqltest2-directory!
|
||||
-- echo # user root:
|
||||
CREATE USER mysqltest_1@localhost;
|
||||
CREATE DATABASE mysqltest2;
|
||||
USE mysqltest2;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (0);
|
||||
connect(con1,localhost,mysqltest_1,,);
|
||||
-- echo # user mysqltest_1:
|
||||
USE test;
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test',
|
||||
PARTITION p2 VALUES IN (2)
|
||||
);
|
||||
-- echo # without the patch for bug#32091 this would create
|
||||
-- echo # files mysqltest2/t1.MYD + .MYI and possible overwrite
|
||||
-- echo # the mysqltest2.t1 table (depending on bug#32111)
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
ALTER TABLE t1 REMOVE PARTITIONING;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1;
|
||||
connection default;
|
||||
-- echo # user root:
|
||||
USE mysqltest2;
|
||||
FLUSH TABLES;
|
||||
-- echo # if the patch works, this should be different
|
||||
-- echo # and before the patch they were the same!
|
||||
SELECT * FROM t1;
|
||||
USE test;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE mysqltest2;
|
||||
# The below test shows that a pre-existing partition can not be
|
||||
# destroyed by a new partition from another table.
|
||||
# (Remember that a table or partition that uses the DATA/INDEX DIR
|
||||
# is symlinked and thus has
|
||||
# 1. the real file in the DATA/INDEX DIR and
|
||||
# 2. a symlink in its default database directory pointing to
|
||||
# the real file.
|
||||
# So it is using/blocking 2 files in (in 2 different directories
|
||||
-- echo # test that symlinks can not overwrite files when CREATE TABLE
|
||||
-- echo # user root:
|
||||
CREATE DATABASE mysqltest2;
|
||||
USE mysqltest2;
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
eval CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
);
|
||||
connection con1;
|
||||
-- echo # user mysqltest_1:
|
||||
USE test;
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error 1,1
|
||||
eval CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
);
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- error 1,1
|
||||
eval CREATE TABLE t1 (a INT)
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (0)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test',
|
||||
PARTITION p1 VALUES IN (1)
|
||||
DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/mysqltest2'
|
||||
);
|
||||
connection default;
|
||||
-- echo # user root (cleanup):
|
||||
DROP DATABASE mysqltest2;
|
||||
USE test;
|
||||
DROP USER mysqltest_1@localhost;
|
||||
disconnect con1;
|
||||
|
||||
|
||||
@@ -120,6 +120,18 @@ enable_query_log;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#32111 - Security Breach via DATA/INDEX DIRECORY and RENAME TABLE
|
||||
#
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
eval CREATE TABLE t1(a INT)
|
||||
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql'
|
||||
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
|
||||
--replace_result $MYSQLTEST_VARDIR TEST_DIR
|
||||
--error 1
|
||||
RENAME TABLE t1 TO user;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Test specifying DATA DIRECTORY that is the same as what would normally
|
||||
# have been chosen. (Bug #8707)
|
||||
|
||||
@@ -161,7 +161,7 @@ select * from information_schema.session_variables where variable_name like 'net
|
||||
set net_buffer_length=1;
|
||||
show variables like 'net_buffer_length';
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
--warning 1292
|
||||
#warning 1292
|
||||
set net_buffer_length=2000000000;
|
||||
show variables like 'net_buffer_length';
|
||||
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
|
||||
|
||||
Reference in New Issue
Block a user