mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
5.5-merge
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
set global default_storage_engine='innodb';
|
||||
set session default_storage_engine='innodb';
|
||||
drop table if exists t1, t2;
|
||||
#
|
||||
# Bug#56287: crash when using Partition datetime in sub in query
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||
c2 varchar(40) not null default '',
|
||||
c3 datetime not NULL,
|
||||
PRIMARY KEY (c1,c3),
|
||||
KEY partidx(c3))
|
||||
ENGINE=InnoDB
|
||||
PARTITION BY RANGE (TO_DAYS(c3))
|
||||
(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')),
|
||||
PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')),
|
||||
PARTITION p201912 VALUES LESS THAN MAXVALUE);
|
||||
insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00');
|
||||
SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
|
||||
PARTITION_NAME TABLE_ROWS
|
||||
p200912 0
|
||||
p201103 1
|
||||
p201912 0
|
||||
SELECT count(*) FROM t1 p where c3 in
|
||||
(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44'
|
||||
and t.c3 > date '2011-04-26 19:18:44') ;
|
||||
count(*)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#54747: Deadlock between REORGANIZE PARTITION and
|
||||
# SELECT is not detected
|
||||
#
|
||||
SET @old_innodb_thread_concurrency:= @@innodb_thread_concurrency;
|
||||
SET GLOBAL innodb_thread_concurrency = 1;
|
||||
set global default_storage_engine='innodb';
|
||||
set session default_storage_engine='innodb';
|
||||
CREATE TABLE t1
|
||||
(user_num BIGINT,
|
||||
hours SMALLINT,
|
||||
@@ -491,4 +517,32 @@ Warning 1265 Data truncated for column 'b' at row 1
|
||||
Error 1067 Invalid default value for 'b'
|
||||
SET SESSION sql_mode = @old_mode;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the
|
||||
# table unusable".
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a))
|
||||
ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2;
|
||||
INSERT INTO t1 values (0,1), (1,2);
|
||||
# The below ALTER should fail. It should leave the
|
||||
# table in its original, non-corrupted, usable state.
|
||||
ALTER TABLE t1 ADD UNIQUE KEY (b);
|
||||
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
|
||||
# The below statements should succeed, as ALTER should
|
||||
# have left table intact.
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` bigint(20) NOT NULL,
|
||||
`b` int(11) NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY KEY (a)
|
||||
PARTITIONS 2 */
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 2
|
||||
0 1
|
||||
DROP TABLE t1;
|
||||
set global default_storage_engine=default;
|
||||
|
Reference in New Issue
Block a user