mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / engines / funcs / t / tc_partition_optimize.test
blobecf35d78a02c50614541d3997305218a551e0500
1 --disable_warnings
2 DROP TABLE IF EXISTS t1;
3 --enable_warnings
4  CREATE TABLE t1 ( c1 INTEGER NOT NULL PRIMARY KEY, c2 CHAR(10)) PARTITION BY RANGE (c1) (
5     PARTITION p0 VALUES LESS THAN (100),
6     PARTITION p1 VALUES LESS THAN (200),
7     PARTITION p2 VALUES LESS THAN (300),
8     PARTITION p3 VALUES LESS THAN (400),
9     PARTITION p4 VALUES LESS THAN (500),
10     PARTITION p5 VALUES LESS THAN MAXVALUE);
11 SHOW TABLES; 
12 INSERT INTO t1 VALUES(0,'abc'),(100,'abc'),(200,'abc'),(300,'abc'),(400,'abc');
13 SELECT * FROM t1 ORDER BY c1;
14 let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`; 
15 --replace_result $ENGINE ENGINE 
16 SHOW CREATE TABLE t1;
17 --disable_result_log
18 #the output depends on engine (engine dependent)
19 ALTER TABLE t1 OPTIMIZE PARTITION p1,p2;
20 --enable_result_log
21 SELECT * FROM t1 ORDER BY c1;
22 let $ENGINE=`select variable_value from information_schema.global_variables where variable_name='STORAGE_ENGINE'`; 
23 --replace_result $ENGINE ENGINE 
24  SHOW CREATE TABLE t1;
25  DROP TABLE t1; SHOW TABLES;