| 1 |
# |
| 2 |
# ANALYZE TABLE for partitioned tables and ANALYZE PARTITION |
| 3 |
# |
| 4 |
--source include/have_partition.inc |
| 5 |
--source ../have_engine.inc |
| 6 |
|
| 7 |
|
| 8 |
--disable_warnings |
| 9 |
DROP TABLE IF EXISTS t1,t2; |
| 10 |
--enable_warnings |
| 11 |
|
| 12 |
--let $partition_options = PARTITION BY HASH(a) PARTITIONS 2 |
| 13 |
--source ../create_table.inc |
| 14 |
if ($mysql_errname) |
| 15 |
{ |
| 16 |
--let $my_last_stmt = $create_statement |
| 17 |
--let $functionality = Partitions |
| 18 |
--source ../unexpected_result.inc |
| 19 |
} |
| 20 |
if (!$mysql_errname) |
| 21 |
{ |
| 22 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g'); |
| 23 |
let $partiton_options = PARTITION BY RANGE(a) ( |
| 24 |
PARTITION p0 VALUES LESS THAN (100), |
| 25 |
PARTITION p1 VALUES LESS THAN MAXVALUE |
| 26 |
); |
| 27 |
--let $table_name = t2 |
| 28 |
--source ../create_table.inc |
| 29 |
|
| 30 |
INSERT INTO t2 (a,b) SELECT a,b FROM t1; |
| 31 |
|
| 32 |
INSERT INTO t1 (a,b) VALUES (3,'c'); |
| 33 |
|
| 34 |
--let $alter_definition = ANALYZE PARTITION p0 |
| 35 |
--source ../alter_table.inc |
| 36 |
if ($mysql_errname) |
| 37 |
{ |
| 38 |
--let $my_last_stmt = $alter_statement |
| 39 |
--let $functionality = ALTER TABLE .. ANALYZE PARTITION |
| 40 |
--source unexpected_result.inc |
| 41 |
} |
| 42 |
|
| 43 |
INSERT INTO t2 (a,b) VALUES (4,'d'), (1000,'e'); |
| 44 |
|
| 45 |
--let $alter_definition = ANALYZE PARTITION LOCAL ALL |
| 46 |
--source ../alter_table.inc |
| 47 |
|
| 48 |
INSERT INTO t1 (a,b) VALUES (5,'f'),(50,'g'); |
| 49 |
|
| 50 |
--let $alter_definition = ANALYZE PARTITION NO_WRITE_TO_BINLOG p1,p0 |
| 51 |
--source ../alter_table.inc |
| 52 |
|
| 53 |
DROP TABLE t1, t2; |
| 54 |
} |
| 55 |
|
| 56 |
let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2; |
| 57 |
--source ../analyze_table.inc |
| 58 |
let $extra_tbl_opts =; |
| 59 |
|
| 60 |
|
| 61 |
--source ../cleanup_engine.inc |