2010-06-17 22:51:35 +02:00
|
|
|
--source include/not_embedded.inc
|
2006-06-12 09:05:24 +02:00
|
|
|
--source include/have_partition.inc
|
2006-05-18 19:16:51 +02:00
|
|
|
--source include/have_innodb.inc
|
|
|
|
|
2008-11-10 21:13:24 +01:00
|
|
|
--disable_warnings
|
2010-03-04 12:29:22 +01:00
|
|
|
drop table if exists t1, t2;
|
2008-11-10 21:13:24 +01:00
|
|
|
--enable_warnings
|
|
|
|
|
2010-01-18 17:49:18 +01:00
|
|
|
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
|
|
|
|
2010-08-13 09:50:25 +02:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#50418: DROP PARTITION does not interact with transactions
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
id INT AUTO_INCREMENT NOT NULL,
|
|
|
|
name CHAR(50) NOT NULL,
|
|
|
|
myDate DATE NOT NULL,
|
|
|
|
PRIMARY KEY (id, myDate),
|
|
|
|
INDEX idx_date (myDate)
|
|
|
|
) ENGINE=InnoDB
|
|
|
|
PARTITION BY RANGE ( TO_DAYS(myDate) ) (
|
|
|
|
PARTITION p0 VALUES LESS THAN (734028),
|
|
|
|
PARTITION p1 VALUES LESS THAN (734029),
|
|
|
|
PARTITION p2 VALUES LESS THAN (734030),
|
|
|
|
PARTITION p3 VALUES LESS THAN MAXVALUE
|
|
|
|
) ;
|
|
|
|
INSERT INTO t1 VALUES
|
|
|
|
(NULL, 'Lachlan', '2009-09-13'),
|
|
|
|
(NULL, 'Clint', '2009-09-13'),
|
|
|
|
(NULL, 'John', '2009-09-14'),
|
|
|
|
(NULL, 'Dave', '2009-09-14'),
|
|
|
|
(NULL, 'Jeremy', '2009-09-15'),
|
|
|
|
(NULL, 'Scott', '2009-09-15'),
|
|
|
|
(NULL, 'Jeff', '2009-09-16'),
|
|
|
|
(NULL, 'Joe', '2009-09-16');
|
|
|
|
SET AUTOCOMMIT=0;
|
|
|
|
SELECT * FROM t1 FOR UPDATE;
|
|
|
|
UPDATE t1 SET name = 'Mattias' WHERE id = 7;
|
|
|
|
SELECT * FROM t1 WHERE id = 7;
|
|
|
|
--connect (con1, localhost, root,,)
|
|
|
|
--echo # Connection con1
|
|
|
|
SET lock_wait_timeout = 1;
|
|
|
|
--echo # After the patch it will wait and fail on timeout.
|
|
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
|
|
ALTER TABLE t1 DROP PARTITION p3;
|
|
|
|
SHOW WARNINGS;
|
|
|
|
--disconnect con1
|
|
|
|
--connection default
|
|
|
|
--echo # Connection default
|
|
|
|
SELECT * FROM t1;
|
|
|
|
--echo # No changes.
|
|
|
|
COMMIT;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2010-03-10 12:56:05 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#51830: Incorrect partition pruning on range partition (regression)
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (a INT NOT NULL)
|
|
|
|
ENGINE = InnoDB
|
|
|
|
PARTITION BY RANGE(a)
|
|
|
|
(PARTITION p10 VALUES LESS THAN (10),
|
|
|
|
PARTITION p30 VALUES LESS THAN (30),
|
|
|
|
PARTITION p50 VALUES LESS THAN (50),
|
|
|
|
PARTITION p70 VALUES LESS THAN (70),
|
|
|
|
PARTITION p90 VALUES LESS THAN (90));
|
|
|
|
INSERT INTO t1 VALUES (10),(30),(50);
|
|
|
|
INSERT INTO t1 VALUES (70);
|
|
|
|
INSERT INTO t1 VALUES (80);
|
|
|
|
INSERT INTO t1 VALUES (89);
|
|
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
|
|
INSERT INTO t1 VALUES (90);
|
|
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
|
|
INSERT INTO t1 VALUES (100);
|
|
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
|
|
|
insert INTO t1 VALUES (110);
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 89;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100;
|
|
|
|
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2010-03-04 12:29:22 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#50104: Partitioned table with just 1 partion works with fk
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t2 (
|
|
|
|
id INT,
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
) ENGINE=InnoDB ;
|
|
|
|
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
id INT NOT NULL AUTO_INCREMENT,
|
|
|
|
parent_id INT DEFAULT NULL,
|
|
|
|
PRIMARY KEY (id),
|
|
|
|
KEY parent_id (parent_id)
|
|
|
|
) ENGINE=InnoDB;
|
|
|
|
|
|
|
|
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 1;
|
|
|
|
|
|
|
|
--error ER_FOREIGN_KEY_ON_PARTITIONED
|
|
|
|
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
|
|
|
|
|
|
|
|
ALTER TABLE t1 PARTITION BY HASH (id) PARTITIONS 2;
|
|
|
|
|
|
|
|
--error ER_FOREIGN_KEY_ON_PARTITIONED
|
|
|
|
ALTER TABLE t1 ADD CONSTRAINT test_ibfk_1 FOREIGN KEY (parent_id) REFERENCES t2 (id);
|
|
|
|
|
|
|
|
DROP TABLE t1, t2;
|
|
|
|
|
2009-11-05 15:42:03 +01:00
|
|
|
#
|
|
|
|
# BUG#47774, Assertion failure in InnoDB using column list partitioning
|
|
|
|
#
|
|
|
|
create table t1 (a varchar(5), b int signed, c varchar(10), d datetime)
|
|
|
|
partition by range columns(b,c)
|
|
|
|
subpartition by hash(to_seconds(d))
|
|
|
|
( partition p0 values less than (2, 'b'),
|
|
|
|
partition p1 values less than (4, 'd'),
|
|
|
|
partition p2 values less than (10, 'za'));
|
|
|
|
insert into t1 values ('a', 3, 'w', '2001-10-27 04:34:00');
|
|
|
|
insert into t1 values ('r', 7, 'w', '2001-10-27 05:34:00');
|
|
|
|
insert into t1 values ('g', 10, 'w', '2001-10-27 06:34:00');
|
|
|
|
update t1 set a = 'c' where a > 'f';
|
|
|
|
drop table t1;
|
|
|
|
|
2009-10-05 16:10:18 +02:00
|
|
|
#
|
|
|
|
# BUG#47776, Failed to update for MEMORY engine, crash for InnoDB and success for MyISAM
|
|
|
|
#
|
|
|
|
create table t1 (a varchar(5))
|
|
|
|
engine=memory
|
2009-10-29 18:04:23 +01:00
|
|
|
partition by range columns(a)
|
2009-10-16 16:16:06 +02:00
|
|
|
( partition p0 values less than ('m'),
|
|
|
|
partition p1 values less than ('za'));
|
2009-10-05 16:10:18 +02:00
|
|
|
insert into t1 values ('j');
|
|
|
|
update t1 set a = 'z' where (a >= 'j');
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
create table t1 (a varchar(5))
|
|
|
|
engine=myisam
|
2009-10-29 18:04:23 +01:00
|
|
|
partition by range columns(a)
|
2009-10-16 16:16:06 +02:00
|
|
|
( partition p0 values less than ('m'),
|
|
|
|
partition p1 values less than ('za'));
|
2009-10-05 16:10:18 +02:00
|
|
|
insert into t1 values ('j');
|
|
|
|
update t1 set a = 'z' where (a >= 'j');
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
create table t1 (a varchar(5))
|
|
|
|
engine=innodb
|
2009-10-29 18:04:23 +01:00
|
|
|
partition by range columns(a)
|
2009-10-16 16:16:06 +02:00
|
|
|
( partition p0 values less than ('m'),
|
|
|
|
partition p1 values less than ('za'));
|
2009-10-05 16:10:18 +02:00
|
|
|
insert into t1 values ('j');
|
|
|
|
update t1 set a = 'z' where (a >= 'j');
|
|
|
|
drop table t1;
|
|
|
|
|
2009-09-07 10:37:54 +02:00
|
|
|
#
|
|
|
|
# Bug#47029: Crash when reorganize partition with subpartition
|
|
|
|
#
|
|
|
|
create table t1 (a int not null,
|
|
|
|
b datetime not null,
|
|
|
|
primary key (a,b))
|
|
|
|
engine=innodb
|
|
|
|
partition by range (to_days(b))
|
|
|
|
subpartition by hash (a)
|
|
|
|
subpartitions 2
|
|
|
|
( partition p0 values less than (to_days('2009-01-01')),
|
|
|
|
partition p1 values less than (to_days('2009-02-01')),
|
|
|
|
partition p2 values less than (to_days('2009-03-01')),
|
|
|
|
partition p3 values less than maxvalue);
|
|
|
|
alter table t1 reorganize partition p1,p2 into
|
|
|
|
( partition p2 values less than (to_days('2009-03-01')));
|
|
|
|
drop table t1;
|
2008-11-10 21:13:24 +01:00
|
|
|
#
|
|
|
|
# Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
|
|
|
|
# with partitions
|
|
|
|
CREATE TABLE t1 (id INT PRIMARY KEY, data INT) ENGINE = InnoDB
|
|
|
|
PARTITION BY RANGE(id) (
|
|
|
|
PARTITION p0 VALUES LESS THAN (5),
|
|
|
|
PARTITION p1 VALUES LESS THAN (10),
|
|
|
|
PARTITION p2 VALUES LESS THAN MAXVALUE
|
|
|
|
);
|
|
|
|
|
|
|
|
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
|
|
|
|
(9,9), (10,10), (11,11);
|
|
|
|
|
|
|
|
SET @old_tx_isolation := @@session.tx_isolation;
|
|
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
|
|
|
|
|
|
SET autocommit = 0;
|
|
|
|
|
|
|
|
UPDATE t1 SET DATA = data*2 WHERE id = 3;
|
|
|
|
|
2008-12-15 14:37:38 +01:00
|
|
|
# SHOW ENGINE InnoDB STATUS does not show transaction info in
|
|
|
|
# PERFORMANCE-VERSION
|
2008-11-14 23:51:17 +01:00
|
|
|
# grouping/referencing in replace_regex is very slow on long strings,
|
|
|
|
# removing all before/after the interesting row before grouping/referencing
|
2008-12-15 14:37:38 +01:00
|
|
|
#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+) lock struct\(s\), heap size [0-9]+, ([0-9]+) row lock\(s\).*/\1 lock struct(s) \2 row lock(s)/
|
|
|
|
#SHOW ENGINE InnoDB STATUS;
|
2008-11-10 21:13:24 +01:00
|
|
|
|
|
|
|
UPDATE t1 SET data = data*2 WHERE data = 2;
|
|
|
|
|
2008-12-15 14:37:38 +01:00
|
|
|
# SHOW ENGINE InnoDB STATUS does not show transaction info in
|
|
|
|
# PERFORMANCE-VERSION
|
2008-11-14 23:51:17 +01:00
|
|
|
# grouping/referencing in replace_regex is very slow on long strings,
|
|
|
|
# removing all before/after the interesting row before grouping/referencing
|
2008-12-15 14:37:38 +01:00
|
|
|
#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
|
|
|
#SHOW ENGINE InnoDB STATUS;
|
2008-11-10 21:13:24 +01:00
|
|
|
|
|
|
|
SET @@session.tx_isolation = @old_tx_isolation;
|
|
|
|
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2008-10-10 12:01:01 +02:00
|
|
|
#
|
|
|
|
# Bug37721: ORDER BY when WHERE contains non-partitioned index column
|
|
|
|
# wrong order since it did not use pk as second compare
|
|
|
|
--echo # Bug#37721, test of ORDER BY on PK and WHERE on INDEX
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
a INT,
|
|
|
|
b INT,
|
|
|
|
PRIMARY KEY (a),
|
|
|
|
INDEX (b))
|
|
|
|
ENGINE InnoDB
|
|
|
|
PARTITION BY HASH(a)
|
|
|
|
PARTITIONS 3;
|
|
|
|
# This will give the middle partition the highest value
|
|
|
|
INSERT INTO t1 VALUES (0,0),(4,0),(2,0);
|
|
|
|
SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
|
|
|
|
SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
|
|
|
|
ALTER TABLE t1 DROP INDEX b;
|
|
|
|
SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
|
|
|
|
SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
|
|
|
|
DROP TABLE t1;
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
a VARCHAR(600),
|
|
|
|
b VARCHAR(600),
|
|
|
|
PRIMARY KEY (a),
|
|
|
|
INDEX (b))
|
|
|
|
ENGINE InnoDB
|
|
|
|
PARTITION BY KEY(a)
|
|
|
|
PARTITIONS 3;
|
|
|
|
# This will give the middle partition the highest value
|
|
|
|
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'1'),repeat('0',257));
|
|
|
|
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'3'),repeat('0',257));
|
|
|
|
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'2'),repeat('0',257));
|
|
|
|
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
|
|
|
|
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
|
|
|
|
ALTER TABLE t1 DROP INDEX b;
|
|
|
|
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
|
|
|
|
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
|
|
|
#
|
2007-12-06 14:43:06 +01:00
|
|
|
# Bug#32948 - FKs allowed to reference partitioned table
|
|
|
|
#
|
|
|
|
-- echo # Bug#32948
|
|
|
|
CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
|
|
|
|
CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
|
|
|
|
FOREIGN KEY (c1) REFERENCES t1 (c1)
|
|
|
|
ON DELETE CASCADE)
|
|
|
|
ENGINE=INNODB;
|
|
|
|
--error ER_ROW_IS_REFERENCED
|
|
|
|
ALTER TABLE t1 PARTITION BY HASH(c1) PARTITIONS 5;
|
|
|
|
--error ER_ROW_IS_REFERENCED
|
|
|
|
ALTER TABLE t1 ENGINE=MyISAM;
|
|
|
|
DROP TABLE t2;
|
|
|
|
DROP TABLE t1;
|
|
|
|
|
2006-05-18 19:16:51 +02:00
|
|
|
#
|
|
|
|
# Bug #14673: Wrong InnoDB default row format
|
|
|
|
#
|
|
|
|
create table t1 (a int) engine=innodb partition by hash(a) ;
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-05-18 19:16:51 +02:00
|
|
|
show table status like 't1';
|
|
|
|
drop table t1;
|
|
|
|
|
2006-09-08 09:18:05 +02:00
|
|
|
#
|
|
|
|
# Bug 21173: SHOW TABLE STATUS crashes server in InnoDB
|
|
|
|
#
|
|
|
|
create table t1 (a int)
|
|
|
|
engine = innodb
|
|
|
|
partition by key (a);
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-09-08 09:18:05 +02:00
|
|
|
show table status;
|
|
|
|
insert into t1 values (0), (1), (2), (3);
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-09-08 09:18:05 +02:00
|
|
|
show table status;
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
create table t1 (a int auto_increment primary key)
|
|
|
|
engine = innodb
|
|
|
|
partition by key (a);
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-09-08 09:18:05 +02:00
|
|
|
show table status;
|
|
|
|
insert into t1 values (NULL), (NULL), (NULL), (NULL);
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-09-08 09:18:05 +02:00
|
|
|
show table status;
|
|
|
|
insert into t1 values (NULL), (NULL), (NULL), (NULL);
|
2008-01-15 06:55:50 +01:00
|
|
|
# Data_free for InnoDB tablespace varies depending on which
|
|
|
|
# tests have been run before this one
|
|
|
|
--replace_column 10 #
|
2006-09-08 09:18:05 +02:00
|
|
|
show table status;
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
#
|
|
|
|
# BUG 19122 Crash after ALTER TABLE t1 REBUILD PARTITION p1
|
|
|
|
#
|
|
|
|
create table t1 (a int)
|
|
|
|
partition by key (a)
|
|
|
|
(partition p1 engine = innodb);
|
|
|
|
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
alter table t1 rebuild partition p1;
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Bug 21339: Crash in Explain Partitions
|
|
|
|
#
|
|
|
|
create table t1 (a date)
|
|
|
|
engine = innodb
|
|
|
|
partition by range (year(a))
|
|
|
|
(partition p0 values less than (2006),
|
|
|
|
partition p1 values less than (2007));
|
|
|
|
explain partitions select * from t1
|
|
|
|
where a between '2006-01-01' and '2007-06-01';
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Bug 20397: Partitions: Crash when using non-existing engine
|
|
|
|
#
|
|
|
|
create table t1 (a int)
|
|
|
|
engine = x
|
|
|
|
partition by key (a);
|
|
|
|
show create table t1;
|
|
|
|
drop table t1;
|
|
|
|
|
|
|
|
create table t1 (a int)
|
|
|
|
engine = innodb
|
|
|
|
partition by list (a)
|
|
|
|
(partition p0 values in (0));
|
|
|
|
|
|
|
|
alter table t1 engine = x;
|
|
|
|
show create table t1;
|
|
|
|
drop table t1;
|
|
|
|
|
2007-02-27 20:01:03 +01:00
|
|
|
# BUG#26117: index_merge sort-union over partitioned table crashes
|
|
|
|
|
|
|
|
create table t1
|
|
|
|
(
|
|
|
|
id int unsigned auto_increment,
|
|
|
|
time datetime not null,
|
|
|
|
first_name varchar(40),
|
|
|
|
last_name varchar(50),
|
|
|
|
primary key (id, time),
|
|
|
|
index first_index (first_name),
|
|
|
|
index last_index (last_name)
|
|
|
|
) engine=Innodb partition by range (to_days(time)) (
|
|
|
|
partition p1 values less than (to_days('2007-02-07')),
|
|
|
|
partition p2 values less than (to_days('2007-02-08')),
|
|
|
|
partition p3 values less than MAXVALUE
|
|
|
|
);
|
|
|
|
|
|
|
|
insert into t1 (time, first_name, last_name) values ('2007-02-07', 'Q', 'Robert'),
|
|
|
|
('2007-02-07', 'Mark', 'Nate'), ('2007-02-07', 'Nate', 'Oscar'),
|
|
|
|
('2007-02-07', 'Zack', 'Alice'), ('2007-02-07', 'Jack', 'Kathy'),
|
|
|
|
('2007-02-06', 'Alice', 'Alice'), ('2007-02-06', 'Brian', 'Charles'),
|
|
|
|
('2007-02-06', 'Charles', 'David'), ('2007-02-06', 'David', 'Eric'),
|
|
|
|
('2007-02-07', 'Hector', 'Isaac'), ('2007-02-07', 'Oscar', 'Patricia'),
|
|
|
|
('2007-02-07', 'Patricia', 'Q'), ('2007-02-07', 'X', 'Yuri'),
|
|
|
|
('2007-02-07', 'Robert', 'Shawn'), ('2007-02-07', 'Kathy', 'Lois'),
|
|
|
|
('2007-02-07', 'Eric', 'Francis'), ('2007-02-06', 'Shawn', 'Theron'),
|
|
|
|
('2007-02-06', 'U', 'Vincent'), ('2007-02-06', 'Francis', 'George'),
|
|
|
|
('2007-02-06', 'George', 'Hector'), ('2007-02-06', 'Vincent', 'Walter'),
|
|
|
|
('2007-02-06', 'Walter', 'X'), ('2007-02-07', 'Lois', 'Mark'),
|
|
|
|
('2007-02-07', 'Yuri', 'Zack'), ('2007-02-07', 'Isaac', 'Jack'),
|
|
|
|
('2007-02-07', 'Sharon', 'Mark'), ('2007-02-07', 'Michael', 'Michelle'),
|
|
|
|
('2007-02-07', 'Derick', 'Nathan'), ('2007-02-07', 'Peter', 'Xavier'),
|
|
|
|
('2007-02-07', 'Fred', 'Harold'), ('2007-02-07', 'Katherine', 'Lisa'),
|
|
|
|
('2007-02-07', 'Tom', 'Rina'), ('2007-02-07', 'Jerry', 'Victor'),
|
|
|
|
('2007-02-07', 'Alexander', 'Terry'), ('2007-02-07', 'Justin', 'John'),
|
|
|
|
('2007-02-07', 'Greg', 'Ernest'), ('2007-02-07', 'Robert', 'Q'),
|
|
|
|
('2007-02-07', 'Nate', 'Mark'), ('2007-02-07', 'Oscar', 'Nate'),
|
|
|
|
('2007-02-07', 'Alice', 'Zack'), ('2007-02-07', 'Kathy', 'Jack'),
|
|
|
|
('2007-02-06', 'Alice', 'Alice'), ('2007-02-06', 'Charles', 'Brian'),
|
|
|
|
('2007-02-06', 'David', 'Charles'), ('2007-02-06', 'Eric', 'David'),
|
|
|
|
('2007-02-07', 'Isaac', 'Hector'), ('2007-02-07', 'Patricia', 'Oscar'),
|
|
|
|
('2007-02-07', 'Q', 'Patricia'), ('2007-02-07', 'Yuri', 'X'),
|
|
|
|
('2007-02-07', 'Shawn', 'Robert'), ('2007-02-07', 'Lois', 'Kathy'),
|
|
|
|
('2007-02-07', 'Francis', 'Eric'), ('2007-02-06', 'Theron', 'Shawn'),
|
|
|
|
('2007-02-06', 'Vincent', 'U'), ('2007-02-06', 'George', 'Francis'),
|
|
|
|
('2007-02-06', 'Hector', 'George'), ('2007-02-06', 'Walter', 'Vincent'),
|
|
|
|
('2007-02-06', 'X', 'Walter'), ('2007-02-07', 'Mark', 'Lois'),
|
|
|
|
('2007-02-07', 'Zack', 'Yuri'), ('2007-02-07', 'Jack', 'Isaac'),
|
|
|
|
('2007-02-07', 'Mark', 'Sharon'), ('2007-02-07', 'Michelle', 'Michael'),
|
|
|
|
('2007-02-07', 'Nathan', 'Derick'), ('2007-02-07', 'Xavier', 'Peter'),
|
|
|
|
('2007-02-07', 'Harold', 'Fred'), ('2007-02-07', 'Lisa', 'Katherine'),
|
|
|
|
('2007-02-07', 'Rina', 'Tom'), ('2007-02-07', 'Victor', 'Jerry'),
|
|
|
|
('2007-02-07', 'Terry', 'Alexander'), ('2007-02-07', 'John', 'Justin'),
|
|
|
|
('2007-02-07', 'Ernest', 'Greg');
|
|
|
|
|
|
|
|
SELECT * FROM t1 WHERE first_name='Andy' OR last_name='Jake';
|
|
|
|
|
|
|
|
drop table t1;
|
2006-09-08 09:18:05 +02:00
|
|
|
|
2007-09-13 15:33:40 +02:00
|
|
|
#
|
|
|
|
# BUG#30583 - Partition on DOUBLE key + INNODB + count(*) == crash
|
|
|
|
#
|
|
|
|
CREATE TABLE t1 (a DOUBLE NOT NULL, KEY(a)) ENGINE=InnoDB
|
|
|
|
PARTITION BY KEY(a) PARTITIONS 10;
|
|
|
|
INSERT INTO t1 VALUES(1),(2);
|
|
|
|
SELECT COUNT(*) FROM t1;
|
|
|
|
DROP TABLE t1;
|
2007-11-12 11:26:09 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Bug #31893 Partitions: crash if subpartitions and engine change
|
|
|
|
#
|
|
|
|
create table t1 (int_column int, char_column char(5))
|
2007-11-13 06:41:59 +01:00
|
|
|
PARTITION BY RANGE (int_column) subpartition by key (char_column) subpartitions 2
|
2007-11-12 11:26:09 +01:00
|
|
|
(PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
|
2008-01-09 13:15:50 +01:00
|
|
|
alter table t1
|
|
|
|
ENGINE = MyISAM
|
|
|
|
PARTITION BY RANGE (int_column)
|
2007-11-13 06:41:59 +01:00
|
|
|
subpartition by key (char_column) subpartitions 2
|
2008-01-09 13:15:50 +01:00
|
|
|
(PARTITION p1 VALUES LESS THAN (5));
|
2007-11-12 11:26:09 +01:00
|
|
|
show create table t1;
|
|
|
|
drop table t1;
|
2009-09-02 13:19:28 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# BUG#46483 - drop table of partitioned table may leave extraneous file
|
|
|
|
# Note: was only repeatable with InnoDB plugin
|
|
|
|
#
|
|
|
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB
|
|
|
|
PARTITION BY list(a) (PARTITION p1 VALUES IN (1));
|
|
|
|
CREATE INDEX i1 ON t1 (a);
|
|
|
|
DROP TABLE t1;
|
2010-01-18 17:49:18 +01:00
|
|
|
|
2009-09-02 13:19:28 +02:00
|
|
|
# Before the fix it should show extra file like #sql-2405_2.par
|
|
|
|
--list_files $MYSQLD_DATADIR/test/ *
|
2010-01-18 17:49:18 +01:00
|
|
|
|
2010-02-06 11:28:06 +01:00
|
|
|
--disable_parsing
|
2010-01-18 17:49:18 +01:00
|
|
|
--echo #
|
|
|
|
--echo # Bug#47343: InnoDB fails to clean-up after lock wait timeout on
|
|
|
|
--echo # REORGANIZE PARTITION
|
|
|
|
--echo #
|
|
|
|
CREATE TABLE t1 (
|
|
|
|
a INT,
|
|
|
|
b DATE NOT NULL,
|
|
|
|
PRIMARY KEY (a, b)
|
|
|
|
) ENGINE=InnoDB
|
|
|
|
PARTITION BY RANGE (a) (
|
|
|
|
PARTITION pMAX VALUES LESS THAN MAXVALUE
|
|
|
|
) ;
|
|
|
|
|
|
|
|
INSERT INTO t1 VALUES (1, '2001-01-01'), (2, '2002-02-02'), (3, '2003-03-03');
|
|
|
|
|
|
|
|
START TRANSACTION;
|
|
|
|
SELECT * FROM t1 FOR UPDATE;
|
|
|
|
|
|
|
|
connect (con1, localhost, root,,);
|
|
|
|
--echo # Connection con1
|
|
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
|
|
ALTER TABLE t1 REORGANIZE PARTITION pMAX INTO
|
|
|
|
(PARTITION p3 VALUES LESS THAN (3),
|
|
|
|
PARTITION pMAX VALUES LESS THAN MAXVALUE);
|
|
|
|
SHOW WARNINGS;
|
|
|
|
--error ER_LOCK_WAIT_TIMEOUT
|
|
|
|
ALTER TABLE t1 REORGANIZE PARTITION pMAX INTO
|
|
|
|
(PARTITION p3 VALUES LESS THAN (3),
|
|
|
|
PARTITION pMAX VALUES LESS THAN MAXVALUE);
|
|
|
|
SHOW WARNINGS;
|
|
|
|
|
|
|
|
#Contents of the 'test' database directory:
|
|
|
|
--list_files $MYSQLD_DATADIR/test
|
|
|
|
|
|
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
|
|
--echo # Connection default
|
|
|
|
SELECT * FROM t1;
|
|
|
|
COMMIT;
|
|
|
|
DROP TABLE t1;
|
2010-02-06 11:28:06 +01:00
|
|
|
--enable_parsing
|
2010-07-06 19:38:03 +02:00
|
|
|
|
|
|
|
--echo #
|
|
|
|
--echo # Bug#54783: optimize table crashes with invalid timestamp default value and NO_ZERO_DATE
|
|
|
|
--echo #
|
|
|
|
|
|
|
|
--disable_warnings
|
|
|
|
DROP TABLE IF EXISTS t1;
|
|
|
|
--enable_warnings
|
|
|
|
|
|
|
|
CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT '0000-00-00 00:00:00')
|
|
|
|
ENGINE=INNODB PARTITION BY LINEAR HASH (a) PARTITIONS 1;
|
|
|
|
SET @old_mode = @@sql_mode;
|
|
|
|
SET SESSION sql_mode = 'NO_ZERO_DATE';
|
|
|
|
OPTIMIZE TABLE t1;
|
|
|
|
SET SESSION sql_mode = @old_mode;
|
|
|
|
DROP TABLE t1;
|