| 1 |
# |
| 2 |
# BUG#20125349 - PERSISTANT STATS IS NOT UPDATED WHEN TTS IS IMPORTED. |
| 3 |
# |
| 4 |
|
| 5 |
let MYSQLD_DATADIR =`SELECT @@datadir`; |
| 6 |
SET @old_innodb_file_per_table = @@innodb_file_per_table; |
| 7 |
|
| 8 |
SET GLOBAL innodb_file_per_table = 1; |
| 9 |
SELECT @@innodb_file_per_table; |
| 10 |
|
| 11 |
CREATE TABLE t1 ( |
| 12 |
col_1 CHAR (255), |
| 13 |
col_2 VARCHAR (255) |
| 14 |
) ENGINE = InnoDB charset latin1; |
| 15 |
|
| 16 |
CREATE INDEX idx1 ON t1(col_1); |
| 17 |
CREATE INDEX idx2 ON t1(col_2); |
| 18 |
|
| 19 |
ANALYZE TABLE t1; |
| 20 |
SHOW INDEXES FROM t1; |
| 21 |
|
| 22 |
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002"); |
| 23 |
|
| 24 |
ANALYZE TABLE t1; |
| 25 |
SHOW INDEXES FROM t1; |
| 26 |
|
| 27 |
ANALYZE TABLE t1; |
| 28 |
SHOW INDEXES FROM t1; |
| 29 |
|
| 30 |
FLUSH TABLES t1 FOR EXPORT; |
| 31 |
perl; |
| 32 |
require 'include/innodb-util.inc'; |
| 33 |
ib_backup_tablespaces("test", "t1"); |
| 34 |
EOF |
| 35 |
|
| 36 |
UNLOCK TABLES; |
| 37 |
|
| 38 |
DROP TABLE t1; |
| 39 |
|
| 40 |
CREATE TABLE t1 ( |
| 41 |
col_1 CHAR (255), |
| 42 |
col_2 VARCHAR (255) |
| 43 |
) ENGINE = InnoDB charset latin1; |
| 44 |
|
| 45 |
CREATE INDEX idx1 ON t1(col_1); |
| 46 |
CREATE INDEX idx2 ON t1(col_2); |
| 47 |
|
| 48 |
ANALYZE TABLE t1; |
| 49 |
SHOW INDEXES FROM t1; |
| 50 |
|
| 51 |
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"); |
| 52 |
|
| 53 |
ANALYZE TABLE t1; |
| 54 |
SHOW INDEXES FROM t1; |
| 55 |
|
| 56 |
ANALYZE TABLE t1; |
| 57 |
SHOW INDEXES FROM t1; |
| 58 |
|
| 59 |
ALTER TABLE t1 DISCARD TABLESPACE; |
| 60 |
|
| 61 |
perl; |
| 62 |
require 'include/innodb-util.inc'; |
| 63 |
ib_discard_tablespaces("test", "t1"); |
| 64 |
ib_restore_tablespaces("test", "t1"); |
| 65 |
EOF |
| 66 |
|
| 67 |
ALTER TABLE t1 IMPORT TABLESPACE; |
| 68 |
|
| 69 |
ANALYZE TABLE t1; |
| 70 |
SHOW INDEXES FROM t1; |
| 71 |
|
| 72 |
ANALYZE TABLE t1; |
| 73 |
SHOW INDEXES FROM t1; |
| 74 |
|
| 75 |
DROP TABLE t1; |
| 76 |
|
| 77 |
SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table; |
| 78 |
|
| 79 |
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.ibd |
| 80 |
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.cfg |