mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
manual merge
This commit is contained in:
@ -1,4 +1,41 @@
|
||||
drop table if exists t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
b varchar(10),
|
||||
PRIMARY KEY (a)
|
||||
)
|
||||
PARTITION BY RANGE (to_days(a)) (
|
||||
PARTITION p1 VALUES LESS THAN (733407),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE
|
||||
);
|
||||
INSERT INTO t1 VALUES ('2007-07-30 17:35:48', 'p1');
|
||||
INSERT INTO t1 VALUES ('2009-07-14 17:35:55', 'pmax');
|
||||
INSERT INTO t1 VALUES ('2009-09-21 17:31:42', 'pmax');
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
2007-07-30 17:35:48 p1
|
||||
2009-07-14 17:35:55 pmax
|
||||
2009-09-21 17:31:42 pmax
|
||||
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
|
||||
PARTITION p3 VALUES LESS THAN (733969),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
2007-07-30 17:35:48 p1
|
||||
2009-07-14 17:35:55 pmax
|
||||
2009-09-21 17:31:42 pmax
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`b` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE (to_days(a))
|
||||
(PARTITION p1 VALUES LESS THAN (733407) ENGINE = MyISAM,
|
||||
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
|
||||
ENGINE=MyISAM
|
||||
PARTITION BY HASH (a);
|
||||
|
Reference in New Issue
Block a user