| 1 |
# |
| 2 |
# Show that datafiles are restricted to known directories. |
| 3 |
# Rules: |
| 4 |
# 1. Known Directories are the unique subsets from the combination of: |
| 5 |
# --datadir, --innobd-directories, --innodb-data-home-dir, --innodb-undo-directory |
| 6 |
# 2. If --innodb-undo-directory is unique, new IBD files are not allowed there. |
| 7 |
# 3. Any location referenced in DATA DIRECTORY must be a Known Directory other than a unique undo dir. |
| 8 |
# 4. CREATE TABLESPACE ... ADD DATAFILE must be a Known Directory other than a unique undo dir. |
| 9 |
# 5. CREATE UNDO TABLESPACE ... ADD DATAFILE must be any Known Directory. |
| 10 |
# 6. At startup, since previous engines did not restrict locations to known directories, |
| 11 |
# anything found will be used as before. But a warning message will be put into the error log. |
| 12 |
# |
| 13 |
SET default_storage_engine=InnoDB; |
| 14 |
# |
| 15 |
# Create a table in a known directory. |
| 16 |
# |
| 17 |
CREATE TABLE t1(c1 INT) DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'; |
| 18 |
SHOW CREATE TABLE t1; |
| 19 |
Table Create Table |
| 20 |
t1 CREATE TABLE `t1` ( |
| 21 |
`c1` int DEFAULT NULL |
| 22 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/known_dir/' |
| 23 |
# |
| 24 |
# Attempt to create a table in an unknown directory. |
| 25 |
# |
| 26 |
CREATE TABLE bad_1 (c1 INT) DATA DIRECTORY='MYSQL_TMP_DIR/unknown_dir'; |
| 27 |
ERROR HY000: The DATA DIRECTORY location must be in a known directory. |
| 28 |
SHOW WARNINGS; |
| 29 |
Level Code Message |
| 30 |
Error 3121 The DATA DIRECTORY location must be in a known directory. |
| 31 |
Error 1031 Table storage engine for 'bad_1' doesn't have this option |
| 32 |
# |
| 33 |
# Attempt to create a table in the datadir. |
| 34 |
# |
| 35 |
CREATE DATABASE data; |
| 36 |
USE data; |
| 37 |
CREATE TABLE bad_2 (c1 INT) DATA DIRECTORY='MYSQLTEST_VARDIR/mysqld.1'; |
| 38 |
ERROR HY000: The DATA DIRECTORY location cannot be the datadir. |
| 39 |
SHOW WARNINGS; |
| 40 |
Level Code Message |
| 41 |
Error 3121 The DATA DIRECTORY location cannot be the datadir. |
| 42 |
Error 1031 Table storage engine for 'bad_2' doesn't have this option |
| 43 |
USE test; |
| 44 |
DROP DATABASE data; |
| 45 |
# |
| 46 |
# Create a table in a non-unique undo directory. |
| 47 |
# |
| 48 |
CREATE TABLE t2 (c1 INT) DATA DIRECTORY='MYSQL_TMP_DIR/undo_dir'; |
| 49 |
SHOW CREATE TABLE t2; |
| 50 |
Table Create Table |
| 51 |
t2 CREATE TABLE `t2` ( |
| 52 |
`c1` int DEFAULT NULL |
| 53 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/undo_dir/' |
| 54 |
# |
| 55 |
# Create a general tablespace in a known directories. |
| 56 |
# |
| 57 |
CREATE TABLESPACE ts1 ADD DATAFILE 'MYSQL_TMP_DIR/known_dir/ts1.ibd'; |
| 58 |
# |
| 59 |
# Attempt to create a general tablespace in an unknown directory. |
| 60 |
# |
| 61 |
CREATE TABLESPACE bad_4 ADD DATAFILE 'MYSQL_TMP_DIR/unknown_dir/bad_4.ibd'; |
| 62 |
ERROR HY000: The DATAFILE location must be in a known directory. |
| 63 |
SHOW WARNINGS; |
| 64 |
Level Code Message |
| 65 |
Error 3121 The DATAFILE location must be in a known directory. |
| 66 |
Error 1528 Failed to create TABLESPACE bad_4 |
| 67 |
Error 3121 Incorrect File Name 'MYSQL_TMP_DIR/unknown_dir/bad_4.ibd'. |
| 68 |
# |
| 69 |
# Create a general tablespace in a non-unique undo directory. |
| 70 |
# |
| 71 |
CREATE TABLESPACE ts2 ADD DATAFILE 'MYSQL_TMP_DIR/undo_dir/ts2.ibd'; |
| 72 |
# |
| 73 |
# Attempt to create a general tablespace in a subdirectory of the datadir. |
| 74 |
# |
| 75 |
CREATE TABLESPACE bad_6 ADD DATAFILE 'general/bad_6.ibd'; |
| 76 |
ERROR HY000: The DATAFILE location cannot be under the datadir. |
| 77 |
SHOW WARNINGS; |
| 78 |
Level Code Message |
| 79 |
Error 3121 The DATAFILE location cannot be under the datadir. |
| 80 |
Error 1528 Failed to create TABLESPACE bad_6 |
| 81 |
Error 3121 Incorrect File Name 'general/bad_6.ibd'. |
| 82 |
# |
| 83 |
# Create an undo tablespace in the unique undo directory. |
| 84 |
# |
| 85 |
CREATE UNDO TABLESPACE undo_003 ADD DATAFILE 'MYSQL_TMP_DIR/undo_dir/undo_003.ibu'; |
| 86 |
# |
| 87 |
# Create an undo tablespace in a known dir other than the unique undo directory. |
| 88 |
# |
| 89 |
CREATE UNDO TABLESPACE undo_004 ADD DATAFILE 'MYSQL_TMP_DIR/known_dir/undo_004.ibu'; |
| 90 |
SELECT NAME, SPACE_TYPE, STATE FROM INFORMATION_SCHEMA.INNODB_TABLESPACES |
| 91 |
WHERE SPACE_TYPE = 'Undo' ORDER BY NAME; |
| 92 |
NAME SPACE_TYPE STATE |
| 93 |
innodb_undo_001 Undo active |
| 94 |
innodb_undo_002 Undo active |
| 95 |
undo_003 Undo active |
| 96 |
undo_004 Undo active |
| 97 |
# |
| 98 |
# Attempt to create an undo tablespace in an unknown directory. |
| 99 |
# |
| 100 |
CREATE UNDO TABLESPACE bad_7 ADD DATAFILE 'MYSQL_TMP_DIR/unknown_dir/bad_7.ibu'; |
| 101 |
ERROR HY000: The UNDO DATAFILE location must be in a known directory. |
| 102 |
SHOW WARNINGS; |
| 103 |
Level Code Message |
| 104 |
Error 3121 The UNDO DATAFILE location must be in a known directory. |
| 105 |
Error 1528 Failed to create UNDO TABLESPACE bad_7 |
| 106 |
Error 3121 Incorrect File Name 'MYSQL_TMP_DIR/unknown_dir/bad_7.ibu'. |
| 107 |
# |
| 108 |
# Create a table with a partitions in known directories. |
| 109 |
# |
| 110 |
CREATE TABLE tp1(c1 INT) |
| 111 |
PARTITION BY HASH(c1) ( |
| 112 |
PARTITION p1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 113 |
PARTITION p2 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 114 |
PARTITION p3 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'); |
| 115 |
SHOW CREATE TABLE tp1; |
| 116 |
Table Create Table |
| 117 |
tp1 CREATE TABLE `tp1` ( |
| 118 |
`c1` int DEFAULT NULL |
| 119 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 120 |
/*!50100 PARTITION BY HASH (`c1`) |
| 121 |
(PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 122 |
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 123 |
PARTITION p3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB) */ |
| 124 |
# |
| 125 |
# Attempt to create a table with a partition in an unknown directory. |
| 126 |
# |
| 127 |
CREATE TABLE bad_8(c1 INT) |
| 128 |
PARTITION BY HASH(c1) ( |
| 129 |
PARTITION p1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 130 |
PARTITION p2 DATA DIRECTORY='MYSQL_TMP_DIR/unknown_dir', |
| 131 |
PARTITION p3 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'); |
| 132 |
ERROR HY000: The DATA DIRECTORY location must be in a known directory. |
| 133 |
SHOW WARNINGS; |
| 134 |
Level Code Message |
| 135 |
Error 3121 The DATA DIRECTORY location must be in a known directory. |
| 136 |
Error 1031 Table storage engine for 'bad_8' doesn't have this option |
| 137 |
# |
| 138 |
# Attempt to create a table with a partition in the undo directory. |
| 139 |
# |
| 140 |
CREATE TABLE tp2(c1 INT) |
| 141 |
PARTITION BY HASH(c1) ( |
| 142 |
PARTITION p1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 143 |
PARTITION p2 DATA DIRECTORY='MYSQL_TMP_DIR/undo_dir', |
| 144 |
PARTITION p3 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'); |
| 145 |
SHOW CREATE TABLE tp2; |
| 146 |
Table Create Table |
| 147 |
tp2 CREATE TABLE `tp2` ( |
| 148 |
`c1` int DEFAULT NULL |
| 149 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 150 |
/*!50100 PARTITION BY HASH (`c1`) |
| 151 |
(PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 152 |
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/undo_dir/' ENGINE = InnoDB, |
| 153 |
PARTITION p3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB) */ |
| 154 |
# |
| 155 |
# Create a table with a sub-partitions in known directories. |
| 156 |
# |
| 157 |
CREATE TABLE tp3(c1 INT, c2 INT) |
| 158 |
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c2) ( |
| 159 |
PARTITION p1 VALUES LESS THAN (10) ( |
| 160 |
SUBPARTITION s1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 161 |
SUBPARTITION s2 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'), |
| 162 |
PARTITION p2 VALUES LESS THAN (20) ( |
| 163 |
SUBPARTITION s3 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 164 |
SUBPARTITION s4 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir')); |
| 165 |
SHOW CREATE TABLE tp3; |
| 166 |
Table Create Table |
| 167 |
tp3 CREATE TABLE `tp3` ( |
| 168 |
`c1` int DEFAULT NULL, |
| 169 |
`c2` int DEFAULT NULL |
| 170 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 171 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 172 |
SUBPARTITION BY HASH (`c2`) |
| 173 |
(PARTITION p1 VALUES LESS THAN (10) |
| 174 |
(SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 175 |
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB), |
| 176 |
PARTITION p2 VALUES LESS THAN (20) |
| 177 |
(SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 178 |
SUBPARTITION s4 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB)) */ |
| 179 |
# |
| 180 |
# Attempt to create a table with a sub-partition in an unknown directory. |
| 181 |
# |
| 182 |
CREATE TABLE bad_10(c1 INT, c2 INT) |
| 183 |
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c2) ( |
| 184 |
PARTITION p1 VALUES LESS THAN (10) ( |
| 185 |
SUBPARTITION s1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 186 |
SUBPARTITION s2 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'), |
| 187 |
PARTITION p2 VALUES LESS THAN (20) ( |
| 188 |
SUBPARTITION s3 DATA DIRECTORY='MYSQL_TMP_DIR/unknown_dir', |
| 189 |
SUBPARTITION s4 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir')); |
| 190 |
ERROR HY000: The DATA DIRECTORY location must be in a known directory. |
| 191 |
SHOW WARNINGS; |
| 192 |
Level Code Message |
| 193 |
Error 3121 The DATA DIRECTORY location must be in a known directory. |
| 194 |
Error 1031 Table storage engine for 'bad_10' doesn't have this option |
| 195 |
# |
| 196 |
# Attempt to create a table with a sub-partition in the undo directory |
| 197 |
# |
| 198 |
CREATE TABLE tp4(c1 INT, c2 INT) |
| 199 |
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c2) ( |
| 200 |
PARTITION p1 VALUES LESS THAN (10) ( |
| 201 |
SUBPARTITION s1 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir', |
| 202 |
SUBPARTITION s2 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir'), |
| 203 |
PARTITION p2 VALUES LESS THAN (20) ( |
| 204 |
SUBPARTITION s3 DATA DIRECTORY='MYSQL_TMP_DIR/undo_dir', |
| 205 |
SUBPARTITION s4 DATA DIRECTORY='MYSQL_TMP_DIR/known_dir')); |
| 206 |
SHOW CREATE TABLE tp4; |
| 207 |
Table Create Table |
| 208 |
tp4 CREATE TABLE `tp4` ( |
| 209 |
`c1` int DEFAULT NULL, |
| 210 |
`c2` int DEFAULT NULL |
| 211 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 212 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 213 |
SUBPARTITION BY HASH (`c2`) |
| 214 |
(PARTITION p1 VALUES LESS THAN (10) |
| 215 |
(SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 216 |
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB), |
| 217 |
PARTITION p2 VALUES LESS THAN (20) |
| 218 |
(SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/undo_dir/' ENGINE = InnoDB, |
| 219 |
SUBPARTITION s4 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB)) */ |
| 220 |
# |
| 221 |
# Attempt to add a partition using an unknown directory. |
| 222 |
# |
| 223 |
ALTER TABLE tp3 ADD PARTITION ( |
| 224 |
PARTITION p3 VALUES LESS THAN (30) ( |
| 225 |
SUBPARTITION s5 DATA DIRECTORY 'MYSQL_TMP_DIR/known_dir', |
| 226 |
SUBPARTITION s6 DATA DIRECTORY 'MYSQL_TMP_DIR/unknown_dir')); |
| 227 |
ERROR HY000: The DATA DIRECTORY location must be in a known directory. |
| 228 |
SHOW WARNINGS; |
| 229 |
Level Code Message |
| 230 |
Error 3121 The DATA DIRECTORY location must be in a known directory. |
| 231 |
Error 1031 Table storage engine for 'tp3' doesn't have this option |
| 232 |
# |
| 233 |
# Successfully add a partition using a known directory. |
| 234 |
# |
| 235 |
ALTER TABLE tp3 ADD PARTITION ( |
| 236 |
PARTITION p3 VALUES LESS THAN (30) ( |
| 237 |
SUBPARTITION s5 DATA DIRECTORY 'MYSQL_TMP_DIR/known_dir', |
| 238 |
SUBPARTITION s6 DATA DIRECTORY 'MYSQL_TMP_DIR/known_dir')); |
| 239 |
SHOW CREATE TABLE tp3; |
| 240 |
Table Create Table |
| 241 |
tp3 CREATE TABLE `tp3` ( |
| 242 |
`c1` int DEFAULT NULL, |
| 243 |
`c2` int DEFAULT NULL |
| 244 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 245 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 246 |
SUBPARTITION BY HASH (`c2`) |
| 247 |
(PARTITION p1 VALUES LESS THAN (10) |
| 248 |
(SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 249 |
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB), |
| 250 |
PARTITION p2 VALUES LESS THAN (20) |
| 251 |
(SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 252 |
SUBPARTITION s4 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB), |
| 253 |
PARTITION p3 VALUES LESS THAN (30) |
| 254 |
(SUBPARTITION s5 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 255 |
SUBPARTITION s6 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB)) */ |
| 256 |
# |
| 257 |
# Attempt to reorganize a partition using an unknown directory. |
| 258 |
# |
| 259 |
ALTER TABLE tp3 REORGANIZE PARTITION p3 INTO ( |
| 260 |
PARTITION p3 VALUES LESS THAN(40) ( |
| 261 |
SUBPARTITION s5 DATA DIRECTORY 'MYSQL_TMP_DIR/unknown_dir', |
| 262 |
SUBPARTITION s6 DATA DIRECTORY 'MYSQL_TMP_DIR/known_dir')); |
| 263 |
ERROR HY000: The DATA DIRECTORY location must be in a known directory. |
| 264 |
SHOW WARNINGS; |
| 265 |
Level Code Message |
| 266 |
Error 3121 The DATA DIRECTORY location must be in a known directory. |
| 267 |
Error 1031 Table storage engine for 'tp3' doesn't have this option |
| 268 |
# |
| 269 |
# Show CREATE TABLE for all six tables. |
| 270 |
# |
| 271 |
SHOW CREATE TABLE t1; |
| 272 |
Table Create Table |
| 273 |
t1 CREATE TABLE `t1` ( |
| 274 |
`c1` int DEFAULT NULL |
| 275 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/known_dir/' |
| 276 |
SHOW CREATE TABLE t2; |
| 277 |
Table Create Table |
| 278 |
t2 CREATE TABLE `t2` ( |
| 279 |
`c1` int DEFAULT NULL |
| 280 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci DATA DIRECTORY='MYSQL_TMP_DIR/undo_dir/' |
| 281 |
SHOW CREATE TABLE tp1; |
| 282 |
Table Create Table |
| 283 |
tp1 CREATE TABLE `tp1` ( |
| 284 |
`c1` int DEFAULT NULL |
| 285 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 286 |
/*!50100 PARTITION BY HASH (`c1`) |
| 287 |
(PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 288 |
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 289 |
PARTITION p3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB) */ |
| 290 |
SHOW CREATE TABLE tp2; |
| 291 |
Table Create Table |
| 292 |
tp2 CREATE TABLE `tp2` ( |
| 293 |
`c1` int DEFAULT NULL |
| 294 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 295 |
/*!50100 PARTITION BY HASH (`c1`) |
| 296 |
(PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 297 |
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/undo_dir/' ENGINE = InnoDB, |
| 298 |
PARTITION p3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB) */ |
| 299 |
SHOW CREATE TABLE tp3; |
| 300 |
Table Create Table |
| 301 |
tp3 CREATE TABLE `tp3` ( |
| 302 |
`c1` int DEFAULT NULL, |
| 303 |
`c2` int DEFAULT NULL |
| 304 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 305 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 306 |
SUBPARTITION BY HASH (`c2`) |
| 307 |
(PARTITION p1 VALUES LESS THAN (10) |
| 308 |
(SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 309 |
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB), |
| 310 |
PARTITION p2 VALUES LESS THAN (20) |
| 311 |
(SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 312 |
SUBPARTITION s4 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB), |
| 313 |
PARTITION p3 VALUES LESS THAN (30) |
| 314 |
(SUBPARTITION s5 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB, |
| 315 |
SUBPARTITION s6 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir' ENGINE = InnoDB)) */ |
| 316 |
SHOW CREATE TABLE tp4; |
| 317 |
Table Create Table |
| 318 |
tp4 CREATE TABLE `tp4` ( |
| 319 |
`c1` int DEFAULT NULL, |
| 320 |
`c2` int DEFAULT NULL |
| 321 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 322 |
/*!50100 PARTITION BY RANGE (`c1`) |
| 323 |
SUBPARTITION BY HASH (`c2`) |
| 324 |
(PARTITION p1 VALUES LESS THAN (10) |
| 325 |
(SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB, |
| 326 |
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB), |
| 327 |
PARTITION p2 VALUES LESS THAN (20) |
| 328 |
(SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/undo_dir/' ENGINE = InnoDB, |
| 329 |
SUBPARTITION s4 DATA DIRECTORY = 'MYSQL_TMP_DIR/known_dir/' ENGINE = InnoDB)) */ |
| 330 |
# |
| 331 |
# Show these tables in information_schema. |
| 332 |
# |
| 333 |
=== information_schema.innodb_tables and innodb_tablespaces === |
| 334 |
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type |
| 335 |
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single |
| 336 |
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single |
| 337 |
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single |
| 338 |
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single |
| 339 |
test/t1 test/t1 97 4 Dynamic 0 Single |
| 340 |
test/t2 test/t2 97 4 Dynamic 0 Single |
| 341 |
test/tp1#p#p1 test/tp1#p#p1 97 4 Dynamic 0 Single |
| 342 |
test/tp1#p#p2 test/tp1#p#p2 97 4 Dynamic 0 Single |
| 343 |
test/tp1#p#p3 test/tp1#p#p3 97 4 Dynamic 0 Single |
| 344 |
test/tp2#p#p1 test/tp2#p#p1 97 4 Dynamic 0 Single |
| 345 |
test/tp2#p#p2 test/tp2#p#p2 97 4 Dynamic 0 Single |
| 346 |
test/tp2#p#p3 test/tp2#p#p3 97 4 Dynamic 0 Single |
| 347 |
test/tp3#p#p1#sp#s1 test/tp3#p#p1#sp#s1 97 5 Dynamic 0 Single |
| 348 |
test/tp3#p#p1#sp#s2 test/tp3#p#p1#sp#s2 97 5 Dynamic 0 Single |
| 349 |
test/tp3#p#p2#sp#s3 test/tp3#p#p2#sp#s3 97 5 Dynamic 0 Single |
| 350 |
test/tp3#p#p2#sp#s4 test/tp3#p#p2#sp#s4 97 5 Dynamic 0 Single |
| 351 |
test/tp3#p#p3#sp#s5 test/tp3#p#p3#sp#s5 97 5 Dynamic 0 Single |
| 352 |
test/tp3#p#p3#sp#s6 test/tp3#p#p3#sp#s6 97 5 Dynamic 0 Single |
| 353 |
test/tp4#p#p1#sp#s1 test/tp4#p#p1#sp#s1 97 5 Dynamic 0 Single |
| 354 |
test/tp4#p#p1#sp#s2 test/tp4#p#p1#sp#s2 97 5 Dynamic 0 Single |
| 355 |
test/tp4#p#p2#sp#s3 test/tp4#p#p2#sp#s3 97 5 Dynamic 0 Single |
| 356 |
test/tp4#p#p2#sp#s4 test/tp4#p#p2#sp#s4 97 5 Dynamic 0 Single |
| 357 |
=== information_schema.innodb_tablespaces and innodb_datafiles === |
| 358 |
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path |
| 359 |
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd |
| 360 |
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd |
| 361 |
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd |
| 362 |
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd |
| 363 |
test/t1 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/t1.ibd |
| 364 |
test/t2 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/undo_dir/test/t2.ibd |
| 365 |
test/tp1#p#p1 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp1#p#p1.ibd |
| 366 |
test/tp1#p#p2 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp1#p#p2.ibd |
| 367 |
test/tp1#p#p3 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp1#p#p3.ibd |
| 368 |
test/tp2#p#p1 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp2#p#p1.ibd |
| 369 |
test/tp2#p#p2 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/undo_dir/test/tp2#p#p2.ibd |
| 370 |
test/tp2#p#p3 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp2#p#p3.ibd |
| 371 |
test/tp3#p#p1#sp#s1 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p1#sp#s1.ibd |
| 372 |
test/tp3#p#p1#sp#s2 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p1#sp#s2.ibd |
| 373 |
test/tp3#p#p2#sp#s3 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p2#sp#s3.ibd |
| 374 |
test/tp3#p#p2#sp#s4 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p2#sp#s4.ibd |
| 375 |
test/tp3#p#p3#sp#s5 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p3#sp#s5.ibd |
| 376 |
test/tp3#p#p3#sp#s6 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp3#p#p3#sp#s6.ibd |
| 377 |
test/tp4#p#p1#sp#s1 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp4#p#p1#sp#s1.ibd |
| 378 |
test/tp4#p#p1#sp#s2 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp4#p#p1#sp#s2.ibd |
| 379 |
test/tp4#p#p2#sp#s3 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/undo_dir/test/tp4#p#p2#sp#s3.ibd |
| 380 |
test/tp4#p#p2#sp#s4 Single DEFAULT 0 1 1 Dynamic MYSQL_TMP_DIR/known_dir/test/tp4#p#p2#sp#s4.ibd |
| 381 |
ts1 General DEFAULT 0 1 1 Any MYSQL_TMP_DIR/known_dir/ts1.ibd |
| 382 |
ts2 General DEFAULT 0 1 1 Any MYSQL_TMP_DIR/undo_dir/ts2.ibd |
| 383 |
=== information_schema.files === |
| 384 |
Space_Name File_Type Engine Status Tablespace_Name Path |
| 385 |
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd |
| 386 |
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd |
| 387 |
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd |
| 388 |
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd |
| 389 |
test/t1 TABLESPACE InnoDB NORMAL test/t1 MYSQL_TMP_DIR/known_dir/test/t1.ibd |
| 390 |
test/t2 TABLESPACE InnoDB NORMAL test/t2 MYSQL_TMP_DIR/undo_dir/test/t2.ibd |
| 391 |
test/tp1#p#p1 TABLESPACE InnoDB NORMAL test/tp1#p#p1 MYSQL_TMP_DIR/known_dir/test/tp1#p#p1.ibd |
| 392 |
test/tp1#p#p2 TABLESPACE InnoDB NORMAL test/tp1#p#p2 MYSQL_TMP_DIR/known_dir/test/tp1#p#p2.ibd |
| 393 |
test/tp1#p#p3 TABLESPACE InnoDB NORMAL test/tp1#p#p3 MYSQL_TMP_DIR/known_dir/test/tp1#p#p3.ibd |
| 394 |
test/tp2#p#p1 TABLESPACE InnoDB NORMAL test/tp2#p#p1 MYSQL_TMP_DIR/known_dir/test/tp2#p#p1.ibd |
| 395 |
test/tp2#p#p2 TABLESPACE InnoDB NORMAL test/tp2#p#p2 MYSQL_TMP_DIR/undo_dir/test/tp2#p#p2.ibd |
| 396 |
test/tp2#p#p3 TABLESPACE InnoDB NORMAL test/tp2#p#p3 MYSQL_TMP_DIR/known_dir/test/tp2#p#p3.ibd |
| 397 |
test/tp3#p#p1#sp#s1 TABLESPACE InnoDB NORMAL test/tp3#p#p1#sp#s1 MYSQL_TMP_DIR/known_dir/test/tp3#p#p1#sp#s1.ibd |
| 398 |
test/tp3#p#p1#sp#s2 TABLESPACE InnoDB NORMAL test/tp3#p#p1#sp#s2 MYSQL_TMP_DIR/known_dir/test/tp3#p#p1#sp#s2.ibd |
| 399 |
test/tp3#p#p2#sp#s3 TABLESPACE InnoDB NORMAL test/tp3#p#p2#sp#s3 MYSQL_TMP_DIR/known_dir/test/tp3#p#p2#sp#s3.ibd |
| 400 |
test/tp3#p#p2#sp#s4 TABLESPACE InnoDB NORMAL test/tp3#p#p2#sp#s4 MYSQL_TMP_DIR/known_dir/test/tp3#p#p2#sp#s4.ibd |
| 401 |
test/tp3#p#p3#sp#s5 TABLESPACE InnoDB NORMAL test/tp3#p#p3#sp#s5 MYSQL_TMP_DIR/known_dir/test/tp3#p#p3#sp#s5.ibd |
| 402 |
test/tp3#p#p3#sp#s6 TABLESPACE InnoDB NORMAL test/tp3#p#p3#sp#s6 MYSQL_TMP_DIR/known_dir/test/tp3#p#p3#sp#s6.ibd |
| 403 |
test/tp4#p#p1#sp#s1 TABLESPACE InnoDB NORMAL test/tp4#p#p1#sp#s1 MYSQL_TMP_DIR/known_dir/test/tp4#p#p1#sp#s1.ibd |
| 404 |
test/tp4#p#p1#sp#s2 TABLESPACE InnoDB NORMAL test/tp4#p#p1#sp#s2 MYSQL_TMP_DIR/known_dir/test/tp4#p#p1#sp#s2.ibd |
| 405 |
test/tp4#p#p2#sp#s3 TABLESPACE InnoDB NORMAL test/tp4#p#p2#sp#s3 MYSQL_TMP_DIR/undo_dir/test/tp4#p#p2#sp#s3.ibd |
| 406 |
test/tp4#p#p2#sp#s4 TABLESPACE InnoDB NORMAL test/tp4#p#p2#sp#s4 MYSQL_TMP_DIR/known_dir/test/tp4#p#p2#sp#s4.ibd |
| 407 |
ts1 TABLESPACE InnoDB NORMAL ts1 MYSQL_TMP_DIR/known_dir/ts1.ibd |
| 408 |
ts2 TABLESPACE InnoDB NORMAL ts2 MYSQL_TMP_DIR/undo_dir/ts2.ibd |
| 409 |
# |
| 410 |
# Validate the messages that should have been put into the error log. |
| 411 |
# |
| 412 |
Pattern "Cannot create a tablespace for table test/bad_1 because the directory is not a valid location. The DATA DIRECTORY location must be in a known directory" found |
| 413 |
Pattern "Cannot create a tablespace for table data/bad_2 because the directory is not a valid location. The DATA DIRECTORY location cannot be the datadir" found |
| 414 |
Pattern "Cannot create tablespace bad_4 because the directory is not a valid location. The DATAFILE location must be in a known directory" found |
| 415 |
Pattern "Cannot create tablespace bad_6 because the directory is not a valid location. The DATAFILE location cannot be under the datadir" found |
| 416 |
Pattern "Cannot create tablespace bad_7 because the directory is not a valid location. The UNDO DATAFILE location must be in a known directory" found |
| 417 |
Pattern "Cannot create a tablespace for table test/bad_8.*p2 because the directory is not a valid location. The DATA DIRECTORY location must be in a known directory" found |
| 418 |
Pattern "Cannot create a tablespace for table test/bad_10.*p2.*s3 because the directory is not a valid location. The DATA DIRECTORY location must be in a known directory" found |
| 419 |
Pattern "Cannot create a tablespace for table test/tp3.*p3.*s6 because the directory is not a valid location. The DATA DIRECTORY location must be in a known directory" found |
| 420 |
Pattern "Cannot create a tablespace for table test/tp3.*p3.*s5#tmp because the directory is not a valid location. The DATA DIRECTORY location must be in a known directory" found |
| 421 |
# |
| 422 |
# Cleanup |
| 423 |
# |
| 424 |
DROP TABLE t1; |
| 425 |
DROP TABLE t2; |
| 426 |
DROP TABLE tp1; |
| 427 |
DROP TABLE tp2; |
| 428 |
DROP TABLE tp3; |
| 429 |
DROP TABLE tp4; |
| 430 |
DROP TABLESPACE ts1; |
| 431 |
DROP TABLESPACE ts2; |
| 432 |
ALTER UNDO TABLESPACE undo_003 SET INACTIVE; |
| 433 |
ALTER UNDO TABLESPACE undo_004 SET INACTIVE; |
| 434 |
DROP UNDO TABLESPACE undo_003; |
| 435 |
DROP UNDO TABLESPACE undo_004; |