| 1 |
CREATE TABLE t1 ( |
| 2 |
c1 INT PRIMARY KEY, |
| 3 |
c2 VARCHAR(50), |
| 4 |
c3 VARCHAR(50), |
| 5 |
c4 VARCHAR(50))ENGINE=InnoDB; |
| 6 |
INSERT INTO t1 VALUES(1, 'AAA_2', 'AAA_3', 'AAA_4'), |
| 7 |
(2, 'BBB_2', 'BBB_3', 'BBB_4'), |
| 8 |
(3, 'CCC_2', 'CCC_3', 'CCC_4'), |
| 9 |
(4, 'DDD_2', 'DDD_3', 'DDD_4'), |
| 10 |
(5, 'EEE_2', 'EEE_3', 'EEE_4'); |
| 11 |
ALTER TABLE t1 CONVERT TO CHARACTER SET 'utf8mb4',ALGORITHM=COPY; |
| 12 |
SELECT n_rows, database_name, lower(table_name) |
| 13 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 14 |
n_rows database_name lower(table_name) |
| 15 |
5 test t1 |
| 16 |
ALTER TABLE t1 ADD COLUMN c5 VARCHAR(15), ALGORITHM = COPY; |
| 17 |
SELECT n_rows, database_name, lower(table_name) |
| 18 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 19 |
n_rows database_name lower(table_name) |
| 20 |
5 test t1 |
| 21 |
ALTER TABLE t1 DROP COLUMN c5, ALGORITHM = COPY; |
| 22 |
SELECT n_rows, database_name, lower(table_name) |
| 23 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 24 |
n_rows database_name lower(table_name) |
| 25 |
5 test t1 |
| 26 |
ALTER TABLE t1 ADD COLUMN c5 VARCHAR(15), ALGORITHM = COPY; |
| 27 |
SELECT n_rows, database_name, lower(table_name) |
| 28 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 29 |
n_rows database_name lower(table_name) |
| 30 |
5 test t1 |
| 31 |
ALTER TABLE t1 DROP COLUMN c5, ALGORITHM = COPY; |
| 32 |
SELECT n_rows, database_name, lower(table_name) |
| 33 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 34 |
n_rows database_name lower(table_name) |
| 35 |
5 test t1 |
| 36 |
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (c4), ALGORITHM=COPY; |
| 37 |
SELECT n_rows, database_name, lower(table_name) |
| 38 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 39 |
n_rows database_name lower(table_name) |
| 40 |
5 test t1 |
| 41 |
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (c1), ALGORITHM = COPY; |
| 42 |
SELECT n_rows, database_name, lower(table_name) |
| 43 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 44 |
n_rows database_name lower(table_name) |
| 45 |
5 test t1 |
| 46 |
ALTER TABLE t1 ADD COLUMN c5 VARCHAR(15), ALGORITHM = INPLACE; |
| 47 |
SELECT n_rows, database_name, lower(table_name) |
| 48 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 49 |
n_rows database_name lower(table_name) |
| 50 |
5 test t1 |
| 51 |
ALTER TABLE t1 DROP COLUMN c5, ALGORITHM = INPLACE; |
| 52 |
SELECT n_rows, database_name, lower(table_name) |
| 53 |
FROM mysql.innodb_table_stats WHERE table_name IN ('t1'); |
| 54 |
n_rows database_name lower(table_name) |
| 55 |
5 test t1 |
| 56 |
CREATE TABLE t2 ( |
| 57 |
c1 INT PRIMARY KEY, |
| 58 |
c2 VARCHAR(50), |
| 59 |
c3 VARCHAR(50), |
| 60 |
c4 VARCHAR(50) |
| 61 |
) ENGINE=InnoDB PARTITION BY RANGE (c1) ( |
| 62 |
PARTITION p1 VALUES LESS THAN (6), |
| 63 |
PARTITION p2 VALUES LESS THAN (11), |
| 64 |
PARTITION p3 VALUES LESS THAN (16), |
| 65 |
PARTITION p4 VALUES LESS THAN (21) |
| 66 |
); |
| 67 |
INSERT INTO t2 VALUES(1, 'AAA_2', 'AAA_3', 'AAA_4'), |
| 68 |
(2, 'BBB_2', 'BBB_3', 'BBB_4'), |
| 69 |
(3, 'CCC_2', 'CCC_3', 'CCC_4'), |
| 70 |
(4, 'DDD_2', 'DDD_3', 'DDD_4'), |
| 71 |
(5, 'EEE_2', 'EEE_3', 'EEE_4'), |
| 72 |
(6, 'FFF_2', 'DDD_3', 'DDD_4'), |
| 73 |
(7, 'GGG_2', 'DDD_3', 'DDD_4'), |
| 74 |
(8, 'HHH_2', 'DDD_3', 'DDD_4'), |
| 75 |
(9, 'III_2', 'DDD_3', 'DDD_4'), |
| 76 |
(10, 'JJJ_2', 'DDD_3', 'DDD_4'), |
| 77 |
(13, 'KKK_2', 'DDD_3', 'DDD_4'), |
| 78 |
(20, 'LLL_2', 'DDD_3', 'DDD_4'); |
| 79 |
ALTER TABLE t2 CONVERT TO CHARACTER SET 'utf8mb4',ALGORITHM=COPY; |
| 80 |
SELECT n_rows, database_name, lower(table_name) |
| 81 |
FROM mysql.innodb_table_stats WHERE table_name LIKE '%t2%'; |
| 82 |
n_rows database_name lower(table_name) |
| 83 |
5 test t2#p#p1 |
| 84 |
5 test t2#p#p2 |
| 85 |
1 test t2#p#p3 |
| 86 |
1 test t2#p#p4 |
| 87 |
ALTER TABLE t2 ADD COLUMN c5 VARCHAR(15), ALGORITHM = COPY; |
| 88 |
SELECT n_rows, database_name, lower(table_name) |
| 89 |
FROM mysql.innodb_table_stats WHERE table_name LIKE '%t2%'; |
| 90 |
n_rows database_name lower(table_name) |
| 91 |
5 test t2#p#p1 |
| 92 |
5 test t2#p#p2 |
| 93 |
1 test t2#p#p3 |
| 94 |
1 test t2#p#p4 |
| 95 |
ALTER TABLE t2 DROP COLUMN c5, ALGORITHM = COPY; |
| 96 |
SELECT n_rows, database_name, lower(table_name) |
| 97 |
FROM mysql.innodb_table_stats WHERE table_name LIKE '%t2%'; |
| 98 |
n_rows database_name lower(table_name) |
| 99 |
5 test t2#p#p1 |
| 100 |
5 test t2#p#p2 |
| 101 |
1 test t2#p#p3 |
| 102 |
1 test t2#p#p4 |
| 103 |
# Test Cleanup. |
| 104 |
DROP TABLE t1; |
| 105 |
DROP TABLE t2; |
| 106 |
# |
| 107 |
# MDEV-38667 Assertion in diagnostics area on DDL stats timeout |
| 108 |
# |
| 109 |
CREATE TABLE t ENGINE=InnoDB AS SELECT * FROM mysql.innodb_table_stats; |
| 110 |
DROP TABLE t; |
| 111 |
# |
| 112 |
# MDEV-38882 Assertion in diagnostics area on DDL stats |
| 113 |
# |
| 114 |
CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
| 115 |
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=InnoDB; |
| 116 |
connect con1,localhost,root,,; |
| 117 |
ALTER TABLE t1 NOWAIT FORCE, ALGORITHM=COPY;; |
| 118 |
connection default; |
| 119 |
ALTER TABLE t2 FORCE, ALGORITHM=COPY; |
| 120 |
connection con1; |
| 121 |
DROP TABLE t1, t2; |