| 1 |
# |
| 2 |
# OPTIMIZE TABLE statements |
| 3 |
# |
| 4 |
# Note: the output is likely to be different for the engine under test, |
| 5 |
# in which case rdiff will be needed. Or, the output might say that |
| 6 |
# the storage engine does not support OPTIMIZE. |
| 7 |
# |
| 8 |
|
| 9 |
--disable_warnings |
| 10 |
DROP TABLE IF EXISTS t1,t2; |
| 11 |
--enable_warnings |
| 12 |
|
| 13 |
--source create_table.inc |
| 14 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); |
| 15 |
--let $table_name = t2 |
| 16 |
--source create_table.inc |
| 17 |
|
| 18 |
INSERT INTO t1 (a,b) VALUES (3,'c'),(4,'d'); |
| 19 |
OPTIMIZE TABLE t1; |
| 20 |
INSERT INTO t2 (a,b) VALUES (4,'d'); |
| 21 |
OPTIMIZE NO_WRITE_TO_BINLOG TABLE t2; |
| 22 |
INSERT INTO t2 (a,b) VALUES (5,'e'); |
| 23 |
INSERT INTO t1 (a,b) VALUES (6,'f'); |
| 24 |
OPTIMIZE LOCAL TABLE t1, t2; |
| 25 |
OPTIMIZE TABLE t1, t2; |
| 26 |
|
| 27 |
DROP TABLE t1, t2; |
| 28 |
|
| 29 |
# OPTIMIZE on a table with index |
| 30 |
|
| 31 |
--let $continue = 1 |
| 32 |
--source have_default_index.inc |
| 33 |
if ($have_default_index) |
| 34 |
{ |
| 35 |
--let $create_definition = a $int_indexed_col, b $char_col, $default_index (a) |
| 36 |
--source create_table.inc |
| 37 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(100,'b'),(2,'c'),(3,'d'); |
| 38 |
OPTIMIZE TABLE t1; |
| 39 |
DROP TABLE t1; |
| 40 |
} |
| 41 |
|
| 42 |
|