| 1 |
# Testing discarded partitions without restart |
| 2 |
CREATE DATABASE partitions; |
| 3 |
CREATE TABLE partitions.export1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 4 |
FLUSH TABLE partitions.export1 FOR EXPORT; |
| 5 |
UNLOCK TABLES; |
| 6 |
CREATE TABLE partitions.t1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 7 |
ALTER TABLE partitions.t1 DISCARD PARTITION p0 TABLESPACE; |
| 8 |
CREATE TABLE partitions.t2(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 9 |
ALTER TABLE partitions.t2 DISCARD PARTITION p0, p1 TABLESPACE; |
| 10 |
ALTER TABLE partitions.t2 IMPORT PARTITION p0 TABLESPACE; |
| 11 |
ALTER TABLE partitions.t2 IMPORT PARTITION p1 TABLESPACE; |
| 12 |
CREATE TABLE partitions.t3(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 13 |
ALTER TABLE partitions.t3 DISCARD PARTITION p0, p1 TABLESPACE; |
| 14 |
ALTER TABLE partitions.t3 IMPORT PARTITION p1 TABLESPACE; |
| 15 |
CREATE TABLE partitions.export2 (c1 INT, c2 INT) |
| 16 |
PARTITION BY RANGE( c2) |
| 17 |
SUBPARTITION BY HASH( c2 ) |
| 18 |
SUBPARTITIONS 2 ( |
| 19 |
PARTITION p0 VALUES LESS THAN (10), |
| 20 |
PARTITION p1 VALUES LESS THAN (20), |
| 21 |
PARTITION p2 VALUES LESS THAN (30), |
| 22 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 23 |
); |
| 24 |
FLUSH TABLE partitions.export2 FOR EXPORT; |
| 25 |
UNLOCK TABLES; |
| 26 |
CREATE TABLE partitions.t4 (c1 INT, c2 INT) |
| 27 |
PARTITION BY RANGE( c2 ) |
| 28 |
SUBPARTITION BY HASH( c2 ) |
| 29 |
SUBPARTITIONS 2 ( |
| 30 |
PARTITION p0 VALUES LESS THAN (10), |
| 31 |
PARTITION p1 VALUES LESS THAN (20), |
| 32 |
PARTITION p2 VALUES LESS THAN (30), |
| 33 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 34 |
); |
| 35 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp0 TABLESPACE; |
| 36 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp1 TABLESPACE; |
| 37 |
ALTER TABLE partitions.t4 DISCARD PARTITION p1sp0 TABLESPACE; |
| 38 |
CREATE TABLE partitions.t5 (c1 INT, c2 INT) |
| 39 |
PARTITION BY RANGE( c2 ) |
| 40 |
SUBPARTITION BY HASH( c2 ) |
| 41 |
SUBPARTITIONS 2 ( |
| 42 |
PARTITION p0 VALUES LESS THAN (10), |
| 43 |
PARTITION p1 VALUES LESS THAN (20), |
| 44 |
PARTITION p2 VALUES LESS THAN (30), |
| 45 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 46 |
); |
| 47 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp0 TABLESPACE; |
| 48 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp1 TABLESPACE; |
| 49 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp0 TABLESPACE; |
| 50 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp1 TABLESPACE; |
| 51 |
ALTER TABLE partitions.t5 DISCARD PARTITION p2sp0 TABLESPACE; |
| 52 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp0 TABLESPACE; |
| 53 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp1 TABLESPACE; |
| 54 |
ALTER TABLE partitions.t5 IMPORT PARTITION p1sp0 TABLESPACE; |
| 55 |
ALTER TABLE partitions.t5 IMPORT PARTITION p2sp0 TABLESPACE; |
| 56 |
CREATE TABLE partitions.t6 (c1 INT, c2 INT) |
| 57 |
PARTITION BY RANGE( c2 ) |
| 58 |
SUBPARTITION BY HASH( c2 ) |
| 59 |
SUBPARTITIONS 2 ( |
| 60 |
PARTITION p0 VALUES LESS THAN (10), |
| 61 |
PARTITION p1 VALUES LESS THAN (20), |
| 62 |
PARTITION p2 VALUES LESS THAN (30), |
| 63 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 64 |
); |
| 65 |
ALTER TABLE partitions.t6 DISCARD PARTITION p0 TABLESPACE; |
| 66 |
ALTER TABLE partitions.t6 DISCARD PARTITION p1sp1 TABLESPACE; |
| 67 |
CREATE TABLE partitions.t7 (c1 INT, c2 INT) |
| 68 |
PARTITION BY RANGE( c2 ) |
| 69 |
SUBPARTITION BY HASH( c2 ) |
| 70 |
SUBPARTITIONS 2 ( |
| 71 |
PARTITION p0 VALUES LESS THAN (10), |
| 72 |
PARTITION p1 VALUES LESS THAN (20), |
| 73 |
PARTITION p2 VALUES LESS THAN (30), |
| 74 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 75 |
); |
| 76 |
ALTER TABLE partitions.t7 DISCARD PARTITION p0 TABLESPACE; |
| 77 |
ALTER TABLE partitions.t7 DISCARD PARTITION p1sp0 TABLESPACE; |
| 78 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp0 TABLESPACE; |
| 79 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp1 TABLESPACE; |
| 80 |
ALTER TABLE partitions.t7 IMPORT PARTITION p1sp0 TABLESPACE; |
| 81 |
SELECT * FROM partitions.t1; |
| 82 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 83 |
SELECT * FROM partitions.t1 PARTITION (p0); |
| 84 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 85 |
SELECT * FROM partitions.t1 PARTITION (p1); |
| 86 |
c1 c2 |
| 87 |
SELECT * FROM partitions.t1 PARTITION (p2); |
| 88 |
c1 c2 |
| 89 |
SELECT * FROM partitions.t1 PARTITION (p3); |
| 90 |
c1 c2 |
| 91 |
SELECT * FROM partitions.t2; |
| 92 |
c1 c2 |
| 93 |
SELECT * FROM partitions.t2 PARTITION (p0); |
| 94 |
c1 c2 |
| 95 |
SELECT * FROM partitions.t2 PARTITION (p1); |
| 96 |
c1 c2 |
| 97 |
SELECT * FROM partitions.t2 PARTITION (p2); |
| 98 |
c1 c2 |
| 99 |
SELECT * FROM partitions.t2 PARTITION (p3); |
| 100 |
c1 c2 |
| 101 |
SELECT * FROM partitions.t3; |
| 102 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 103 |
SELECT * FROM partitions.t3 PARTITION (p0); |
| 104 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 105 |
SELECT * FROM partitions.t3 PARTITION (p1); |
| 106 |
c1 c2 |
| 107 |
SELECT * FROM partitions.t3 PARTITION (p2); |
| 108 |
c1 c2 |
| 109 |
SELECT * FROM partitions.t3 PARTITION (p3); |
| 110 |
c1 c2 |
| 111 |
SELECT * FROM partitions.t4; |
| 112 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 113 |
SELECT * FROM partitions.t4 PARTITION (p0); |
| 114 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 115 |
SELECT * FROM partitions.t4 PARTITION (p0sp0); |
| 116 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 117 |
SELECT * FROM partitions.t4 PARTITION (p0sp1); |
| 118 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 119 |
SELECT * FROM partitions.t4 PARTITION (p1); |
| 120 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 121 |
SELECT * FROM partitions.t4 PARTITION (p1sp0); |
| 122 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 123 |
SELECT * FROM partitions.t4 PARTITION (p1sp1); |
| 124 |
c1 c2 |
| 125 |
SELECT * FROM partitions.t4 PARTITION (p2); |
| 126 |
c1 c2 |
| 127 |
SELECT * FROM partitions.t4 PARTITION (p2sp0); |
| 128 |
c1 c2 |
| 129 |
SELECT * FROM partitions.t4 PARTITION (p2sp1); |
| 130 |
c1 c2 |
| 131 |
SELECT * FROM partitions.t5; |
| 132 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 133 |
SELECT * FROM partitions.t5 PARTITION (p0); |
| 134 |
c1 c2 |
| 135 |
SELECT * FROM partitions.t5 PARTITION (p0sp0); |
| 136 |
c1 c2 |
| 137 |
SELECT * FROM partitions.t5 PARTITION (p0sp1); |
| 138 |
c1 c2 |
| 139 |
SELECT * FROM partitions.t5 PARTITION (p1); |
| 140 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 141 |
SELECT * FROM partitions.t5 PARTITION (p1sp0); |
| 142 |
c1 c2 |
| 143 |
SELECT * FROM partitions.t5 PARTITION (p1sp1); |
| 144 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 145 |
SELECT * FROM partitions.t5 PARTITION (p2); |
| 146 |
c1 c2 |
| 147 |
SELECT * FROM partitions.t5 PARTITION (p2sp0); |
| 148 |
c1 c2 |
| 149 |
SELECT * FROM partitions.t5 PARTITION (p2sp1); |
| 150 |
c1 c2 |
| 151 |
SELECT * FROM partitions.t6; |
| 152 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 153 |
SELECT * FROM partitions.t6 PARTITION (p0); |
| 154 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 155 |
SELECT * FROM partitions.t6 PARTITION (p0sp0); |
| 156 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 157 |
SELECT * FROM partitions.t6 PARTITION (p0sp1); |
| 158 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 159 |
SELECT * FROM partitions.t6 PARTITION (p1); |
| 160 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 161 |
SELECT * FROM partitions.t6 PARTITION (p1sp0); |
| 162 |
c1 c2 |
| 163 |
SELECT * FROM partitions.t6 PARTITION (p1sp1); |
| 164 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 165 |
SELECT * FROM partitions.t6 PARTITION (p2); |
| 166 |
c1 c2 |
| 167 |
SELECT * FROM partitions.t6 PARTITION (p2sp0); |
| 168 |
c1 c2 |
| 169 |
SELECT * FROM partitions.t6 PARTITION (p2sp1); |
| 170 |
c1 c2 |
| 171 |
SELECT * FROM partitions.t7; |
| 172 |
c1 c2 |
| 173 |
SELECT * FROM partitions.t7 PARTITION (p0); |
| 174 |
c1 c2 |
| 175 |
SELECT * FROM partitions.t7 PARTITION (p0sp0); |
| 176 |
c1 c2 |
| 177 |
SELECT * FROM partitions.t7 PARTITION (p0sp1); |
| 178 |
c1 c2 |
| 179 |
SELECT * FROM partitions.t7 PARTITION (p1); |
| 180 |
c1 c2 |
| 181 |
SELECT * FROM partitions.t7 PARTITION (p1sp0); |
| 182 |
c1 c2 |
| 183 |
SELECT * FROM partitions.t7 PARTITION (p1sp1); |
| 184 |
c1 c2 |
| 185 |
SELECT * FROM partitions.t7 PARTITION (p2); |
| 186 |
c1 c2 |
| 187 |
SELECT * FROM partitions.t7 PARTITION (p2sp0); |
| 188 |
c1 c2 |
| 189 |
SELECT * FROM partitions.t7 PARTITION (p2sp1); |
| 190 |
c1 c2 |
| 191 |
ALTER TABLE partitions.t1 REBUILD PARTITION p0; |
| 192 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 193 |
ALTER TABLE partitions.t1 REBUILD PARTITION p1; |
| 194 |
Warnings: |
| 195 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 196 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 197 |
ALTER TABLE partitions.t1 REBUILD PARTITION p2; |
| 198 |
Warnings: |
| 199 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 200 |
ALTER TABLE partitions.t1 REBUILD PARTITION p3; |
| 201 |
Warnings: |
| 202 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 203 |
ALTER TABLE partitions.t2 REBUILD PARTITION p0; |
| 204 |
ALTER TABLE partitions.t2 REBUILD PARTITION p1; |
| 205 |
ALTER TABLE partitions.t2 REBUILD PARTITION p2; |
| 206 |
ALTER TABLE partitions.t2 REBUILD PARTITION p3; |
| 207 |
ALTER TABLE partitions.t3 REBUILD PARTITION p0; |
| 208 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 209 |
ALTER TABLE partitions.t3 REBUILD PARTITION p1; |
| 210 |
Warnings: |
| 211 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 212 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 213 |
ALTER TABLE partitions.t3 REBUILD PARTITION p2; |
| 214 |
Warnings: |
| 215 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 216 |
ALTER TABLE partitions.t3 REBUILD PARTITION p3; |
| 217 |
Warnings: |
| 218 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 219 |
ALTER TABLE partitions.t4 REBUILD PARTITION p0; |
| 220 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 221 |
ALTER TABLE partitions.t4 REBUILD PARTITION p1; |
| 222 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 223 |
ALTER TABLE partitions.t4 REBUILD PARTITION p2; |
| 224 |
Warnings: |
| 225 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 226 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 227 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 228 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 229 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 230 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 231 |
ALTER TABLE partitions.t5 REBUILD PARTITION p0; |
| 232 |
Warnings: |
| 233 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 234 |
ALTER TABLE partitions.t5 REBUILD PARTITION p1; |
| 235 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 236 |
ALTER TABLE partitions.t5 REBUILD PARTITION p2; |
| 237 |
Warnings: |
| 238 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 239 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 240 |
ALTER TABLE partitions.t6 REBUILD PARTITION p0; |
| 241 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 242 |
ALTER TABLE partitions.t6 REBUILD PARTITION p1; |
| 243 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 244 |
ALTER TABLE partitions.t6 REBUILD PARTITION p2; |
| 245 |
Warnings: |
| 246 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 247 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 248 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 249 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 250 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 251 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 252 |
ALTER TABLE partitions.t7 REBUILD PARTITION p0; |
| 253 |
ALTER TABLE partitions.t7 REBUILD PARTITION p1; |
| 254 |
ALTER TABLE partitions.t7 REBUILD PARTITION p2; |
| 255 |
DROP TABLE partitions.t1; |
| 256 |
DROP TABLE partitions.t2; |
| 257 |
DROP TABLE partitions.t3; |
| 258 |
DROP TABLE partitions.t4; |
| 259 |
DROP TABLE partitions.t5; |
| 260 |
DROP TABLE partitions.t6; |
| 261 |
DROP TABLE partitions.t7; |
| 262 |
DROP DATABASE partitions; |
| 263 |
# Testing discarded partitions with restart |
| 264 |
CREATE DATABASE partitions; |
| 265 |
CREATE TABLE partitions.export1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 266 |
FLUSH TABLE partitions.export1 FOR EXPORT; |
| 267 |
UNLOCK TABLES; |
| 268 |
CREATE TABLE partitions.t1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 269 |
ALTER TABLE partitions.t1 DISCARD PARTITION p0 TABLESPACE; |
| 270 |
CREATE TABLE partitions.t2(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 271 |
ALTER TABLE partitions.t2 DISCARD PARTITION p0, p1 TABLESPACE; |
| 272 |
ALTER TABLE partitions.t2 IMPORT PARTITION p0 TABLESPACE; |
| 273 |
ALTER TABLE partitions.t2 IMPORT PARTITION p1 TABLESPACE; |
| 274 |
CREATE TABLE partitions.t3(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 275 |
ALTER TABLE partitions.t3 DISCARD PARTITION p0, p1 TABLESPACE; |
| 276 |
ALTER TABLE partitions.t3 IMPORT PARTITION p1 TABLESPACE; |
| 277 |
CREATE TABLE partitions.export2 (c1 INT, c2 INT) |
| 278 |
PARTITION BY RANGE( c2) |
| 279 |
SUBPARTITION BY HASH( c2 ) |
| 280 |
SUBPARTITIONS 2 ( |
| 281 |
PARTITION p0 VALUES LESS THAN (10), |
| 282 |
PARTITION p1 VALUES LESS THAN (20), |
| 283 |
PARTITION p2 VALUES LESS THAN (30), |
| 284 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 285 |
); |
| 286 |
FLUSH TABLE partitions.export2 FOR EXPORT; |
| 287 |
UNLOCK TABLES; |
| 288 |
CREATE TABLE partitions.t4 (c1 INT, c2 INT) |
| 289 |
PARTITION BY RANGE( c2 ) |
| 290 |
SUBPARTITION BY HASH( c2 ) |
| 291 |
SUBPARTITIONS 2 ( |
| 292 |
PARTITION p0 VALUES LESS THAN (10), |
| 293 |
PARTITION p1 VALUES LESS THAN (20), |
| 294 |
PARTITION p2 VALUES LESS THAN (30), |
| 295 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 296 |
); |
| 297 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp0 TABLESPACE; |
| 298 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp1 TABLESPACE; |
| 299 |
ALTER TABLE partitions.t4 DISCARD PARTITION p1sp0 TABLESPACE; |
| 300 |
CREATE TABLE partitions.t5 (c1 INT, c2 INT) |
| 301 |
PARTITION BY RANGE( c2 ) |
| 302 |
SUBPARTITION BY HASH( c2 ) |
| 303 |
SUBPARTITIONS 2 ( |
| 304 |
PARTITION p0 VALUES LESS THAN (10), |
| 305 |
PARTITION p1 VALUES LESS THAN (20), |
| 306 |
PARTITION p2 VALUES LESS THAN (30), |
| 307 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 308 |
); |
| 309 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp0 TABLESPACE; |
| 310 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp1 TABLESPACE; |
| 311 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp0 TABLESPACE; |
| 312 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp1 TABLESPACE; |
| 313 |
ALTER TABLE partitions.t5 DISCARD PARTITION p2sp0 TABLESPACE; |
| 314 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp0 TABLESPACE; |
| 315 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp1 TABLESPACE; |
| 316 |
ALTER TABLE partitions.t5 IMPORT PARTITION p1sp0 TABLESPACE; |
| 317 |
ALTER TABLE partitions.t5 IMPORT PARTITION p2sp0 TABLESPACE; |
| 318 |
CREATE TABLE partitions.t6 (c1 INT, c2 INT) |
| 319 |
PARTITION BY RANGE( c2 ) |
| 320 |
SUBPARTITION BY HASH( c2 ) |
| 321 |
SUBPARTITIONS 2 ( |
| 322 |
PARTITION p0 VALUES LESS THAN (10), |
| 323 |
PARTITION p1 VALUES LESS THAN (20), |
| 324 |
PARTITION p2 VALUES LESS THAN (30), |
| 325 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 326 |
); |
| 327 |
ALTER TABLE partitions.t6 DISCARD PARTITION p0 TABLESPACE; |
| 328 |
ALTER TABLE partitions.t6 DISCARD PARTITION p1sp1 TABLESPACE; |
| 329 |
CREATE TABLE partitions.t7 (c1 INT, c2 INT) |
| 330 |
PARTITION BY RANGE( c2 ) |
| 331 |
SUBPARTITION BY HASH( c2 ) |
| 332 |
SUBPARTITIONS 2 ( |
| 333 |
PARTITION p0 VALUES LESS THAN (10), |
| 334 |
PARTITION p1 VALUES LESS THAN (20), |
| 335 |
PARTITION p2 VALUES LESS THAN (30), |
| 336 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 337 |
); |
| 338 |
ALTER TABLE partitions.t7 DISCARD PARTITION p0 TABLESPACE; |
| 339 |
ALTER TABLE partitions.t7 DISCARD PARTITION p1sp0 TABLESPACE; |
| 340 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp0 TABLESPACE; |
| 341 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp1 TABLESPACE; |
| 342 |
ALTER TABLE partitions.t7 IMPORT PARTITION p1sp0 TABLESPACE; |
| 343 |
# restart |
| 344 |
SELECT * FROM partitions.t1; |
| 345 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 346 |
SELECT * FROM partitions.t1 PARTITION (p0); |
| 347 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 348 |
SELECT * FROM partitions.t1 PARTITION (p1); |
| 349 |
c1 c2 |
| 350 |
SELECT * FROM partitions.t1 PARTITION (p2); |
| 351 |
c1 c2 |
| 352 |
SELECT * FROM partitions.t1 PARTITION (p3); |
| 353 |
c1 c2 |
| 354 |
SELECT * FROM partitions.t2; |
| 355 |
c1 c2 |
| 356 |
SELECT * FROM partitions.t2 PARTITION (p0); |
| 357 |
c1 c2 |
| 358 |
SELECT * FROM partitions.t2 PARTITION (p1); |
| 359 |
c1 c2 |
| 360 |
SELECT * FROM partitions.t2 PARTITION (p2); |
| 361 |
c1 c2 |
| 362 |
SELECT * FROM partitions.t2 PARTITION (p3); |
| 363 |
c1 c2 |
| 364 |
SELECT * FROM partitions.t3; |
| 365 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 366 |
SELECT * FROM partitions.t3 PARTITION (p0); |
| 367 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 368 |
SELECT * FROM partitions.t3 PARTITION (p1); |
| 369 |
c1 c2 |
| 370 |
SELECT * FROM partitions.t3 PARTITION (p2); |
| 371 |
c1 c2 |
| 372 |
SELECT * FROM partitions.t3 PARTITION (p3); |
| 373 |
c1 c2 |
| 374 |
SELECT * FROM partitions.t4; |
| 375 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 376 |
SELECT * FROM partitions.t4 PARTITION (p0); |
| 377 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 378 |
SELECT * FROM partitions.t4 PARTITION (p0sp0); |
| 379 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 380 |
SELECT * FROM partitions.t4 PARTITION (p0sp1); |
| 381 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 382 |
SELECT * FROM partitions.t4 PARTITION (p1); |
| 383 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 384 |
SELECT * FROM partitions.t4 PARTITION (p1sp0); |
| 385 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 386 |
SELECT * FROM partitions.t4 PARTITION (p1sp1); |
| 387 |
c1 c2 |
| 388 |
SELECT * FROM partitions.t4 PARTITION (p2); |
| 389 |
c1 c2 |
| 390 |
SELECT * FROM partitions.t4 PARTITION (p2sp0); |
| 391 |
c1 c2 |
| 392 |
SELECT * FROM partitions.t4 PARTITION (p2sp1); |
| 393 |
c1 c2 |
| 394 |
SELECT * FROM partitions.t5; |
| 395 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 396 |
SELECT * FROM partitions.t5 PARTITION (p0); |
| 397 |
c1 c2 |
| 398 |
SELECT * FROM partitions.t5 PARTITION (p0sp0); |
| 399 |
c1 c2 |
| 400 |
SELECT * FROM partitions.t5 PARTITION (p0sp1); |
| 401 |
c1 c2 |
| 402 |
SELECT * FROM partitions.t5 PARTITION (p1); |
| 403 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 404 |
SELECT * FROM partitions.t5 PARTITION (p1sp0); |
| 405 |
c1 c2 |
| 406 |
SELECT * FROM partitions.t5 PARTITION (p1sp1); |
| 407 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 408 |
SELECT * FROM partitions.t5 PARTITION (p2); |
| 409 |
c1 c2 |
| 410 |
SELECT * FROM partitions.t5 PARTITION (p2sp0); |
| 411 |
c1 c2 |
| 412 |
SELECT * FROM partitions.t5 PARTITION (p2sp1); |
| 413 |
c1 c2 |
| 414 |
SELECT * FROM partitions.t6; |
| 415 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 416 |
SELECT * FROM partitions.t6 PARTITION (p0); |
| 417 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 418 |
SELECT * FROM partitions.t6 PARTITION (p0sp0); |
| 419 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 420 |
SELECT * FROM partitions.t6 PARTITION (p0sp1); |
| 421 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 422 |
SELECT * FROM partitions.t6 PARTITION (p1); |
| 423 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 424 |
SELECT * FROM partitions.t6 PARTITION (p1sp0); |
| 425 |
c1 c2 |
| 426 |
SELECT * FROM partitions.t6 PARTITION (p1sp1); |
| 427 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 428 |
SELECT * FROM partitions.t6 PARTITION (p2); |
| 429 |
c1 c2 |
| 430 |
SELECT * FROM partitions.t6 PARTITION (p2sp0); |
| 431 |
c1 c2 |
| 432 |
SELECT * FROM partitions.t6 PARTITION (p2sp1); |
| 433 |
c1 c2 |
| 434 |
SELECT * FROM partitions.t7; |
| 435 |
c1 c2 |
| 436 |
SELECT * FROM partitions.t7 PARTITION (p0); |
| 437 |
c1 c2 |
| 438 |
SELECT * FROM partitions.t7 PARTITION (p0sp0); |
| 439 |
c1 c2 |
| 440 |
SELECT * FROM partitions.t7 PARTITION (p0sp1); |
| 441 |
c1 c2 |
| 442 |
SELECT * FROM partitions.t7 PARTITION (p1); |
| 443 |
c1 c2 |
| 444 |
SELECT * FROM partitions.t7 PARTITION (p1sp0); |
| 445 |
c1 c2 |
| 446 |
SELECT * FROM partitions.t7 PARTITION (p1sp1); |
| 447 |
c1 c2 |
| 448 |
SELECT * FROM partitions.t7 PARTITION (p2); |
| 449 |
c1 c2 |
| 450 |
SELECT * FROM partitions.t7 PARTITION (p2sp0); |
| 451 |
c1 c2 |
| 452 |
SELECT * FROM partitions.t7 PARTITION (p2sp1); |
| 453 |
c1 c2 |
| 454 |
ALTER TABLE partitions.t1 REBUILD PARTITION p0; |
| 455 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 456 |
ALTER TABLE partitions.t1 REBUILD PARTITION p1; |
| 457 |
Warnings: |
| 458 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 459 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 460 |
ALTER TABLE partitions.t1 REBUILD PARTITION p2; |
| 461 |
Warnings: |
| 462 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 463 |
ALTER TABLE partitions.t1 REBUILD PARTITION p3; |
| 464 |
Warnings: |
| 465 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't1' |
| 466 |
ALTER TABLE partitions.t2 REBUILD PARTITION p0; |
| 467 |
ALTER TABLE partitions.t2 REBUILD PARTITION p1; |
| 468 |
ALTER TABLE partitions.t2 REBUILD PARTITION p2; |
| 469 |
ALTER TABLE partitions.t2 REBUILD PARTITION p3; |
| 470 |
ALTER TABLE partitions.t3 REBUILD PARTITION p0; |
| 471 |
ERROR HY000: Tablespace has been discarded for table 't3' |
| 472 |
ALTER TABLE partitions.t3 REBUILD PARTITION p1; |
| 473 |
Warnings: |
| 474 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 475 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 476 |
ALTER TABLE partitions.t3 REBUILD PARTITION p2; |
| 477 |
Warnings: |
| 478 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 479 |
ALTER TABLE partitions.t3 REBUILD PARTITION p3; |
| 480 |
Warnings: |
| 481 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't3' |
| 482 |
ALTER TABLE partitions.t4 REBUILD PARTITION p0; |
| 483 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 484 |
ALTER TABLE partitions.t4 REBUILD PARTITION p1; |
| 485 |
ERROR HY000: Tablespace has been discarded for table 't4' |
| 486 |
ALTER TABLE partitions.t4 REBUILD PARTITION p2; |
| 487 |
Warnings: |
| 488 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 489 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 490 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 491 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 492 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 493 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't4' |
| 494 |
ALTER TABLE partitions.t5 REBUILD PARTITION p0; |
| 495 |
Warnings: |
| 496 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 497 |
ALTER TABLE partitions.t5 REBUILD PARTITION p1; |
| 498 |
ERROR HY000: Tablespace has been discarded for table 't5' |
| 499 |
ALTER TABLE partitions.t5 REBUILD PARTITION p2; |
| 500 |
Warnings: |
| 501 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 502 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't5' |
| 503 |
ALTER TABLE partitions.t6 REBUILD PARTITION p0; |
| 504 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 505 |
ALTER TABLE partitions.t6 REBUILD PARTITION p1; |
| 506 |
ERROR HY000: Tablespace has been discarded for table 't6' |
| 507 |
ALTER TABLE partitions.t6 REBUILD PARTITION p2; |
| 508 |
Warnings: |
| 509 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 510 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 511 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 512 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 513 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 514 |
Warning 1814 InnoDB: Tablespace has been discarded for table 't6' |
| 515 |
ALTER TABLE partitions.t7 REBUILD PARTITION p0; |
| 516 |
ALTER TABLE partitions.t7 REBUILD PARTITION p1; |
| 517 |
ALTER TABLE partitions.t7 REBUILD PARTITION p2; |
| 518 |
DROP TABLE partitions.t1; |
| 519 |
DROP TABLE partitions.t2; |
| 520 |
DROP TABLE partitions.t3; |
| 521 |
DROP TABLE partitions.t4; |
| 522 |
DROP TABLE partitions.t5; |
| 523 |
DROP TABLE partitions.t6; |
| 524 |
DROP TABLE partitions.t7; |
| 525 |
DROP DATABASE partitions; |
| 526 |
# Test shutdown just after rebuild partition |
| 527 |
CREATE DATABASE partitions; |
| 528 |
CREATE TABLE partitions.export1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 529 |
FLUSH TABLE partitions.export1 FOR EXPORT; |
| 530 |
UNLOCK TABLES; |
| 531 |
CREATE TABLE partitions.t1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 532 |
ALTER TABLE partitions.t1 DISCARD PARTITION p0 TABLESPACE; |
| 533 |
CREATE TABLE partitions.t2(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 534 |
ALTER TABLE partitions.t2 DISCARD PARTITION p0, p1 TABLESPACE; |
| 535 |
ALTER TABLE partitions.t2 IMPORT PARTITION p0 TABLESPACE; |
| 536 |
ALTER TABLE partitions.t2 IMPORT PARTITION p1 TABLESPACE; |
| 537 |
CREATE TABLE partitions.t3(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; |
| 538 |
ALTER TABLE partitions.t3 DISCARD PARTITION p0, p1 TABLESPACE; |
| 539 |
ALTER TABLE partitions.t3 IMPORT PARTITION p1 TABLESPACE; |
| 540 |
CREATE TABLE partitions.export2 (c1 INT, c2 INT) |
| 541 |
PARTITION BY RANGE( c2) |
| 542 |
SUBPARTITION BY HASH( c2 ) |
| 543 |
SUBPARTITIONS 2 ( |
| 544 |
PARTITION p0 VALUES LESS THAN (10), |
| 545 |
PARTITION p1 VALUES LESS THAN (20), |
| 546 |
PARTITION p2 VALUES LESS THAN (30), |
| 547 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 548 |
); |
| 549 |
FLUSH TABLE partitions.export2 FOR EXPORT; |
| 550 |
UNLOCK TABLES; |
| 551 |
CREATE TABLE partitions.t4 (c1 INT, c2 INT) |
| 552 |
PARTITION BY RANGE( c2 ) |
| 553 |
SUBPARTITION BY HASH( c2 ) |
| 554 |
SUBPARTITIONS 2 ( |
| 555 |
PARTITION p0 VALUES LESS THAN (10), |
| 556 |
PARTITION p1 VALUES LESS THAN (20), |
| 557 |
PARTITION p2 VALUES LESS THAN (30), |
| 558 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 559 |
); |
| 560 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp0 TABLESPACE; |
| 561 |
ALTER TABLE partitions.t4 DISCARD PARTITION p0sp1 TABLESPACE; |
| 562 |
ALTER TABLE partitions.t4 DISCARD PARTITION p1sp0 TABLESPACE; |
| 563 |
CREATE TABLE partitions.t5 (c1 INT, c2 INT) |
| 564 |
PARTITION BY RANGE( c2 ) |
| 565 |
SUBPARTITION BY HASH( c2 ) |
| 566 |
SUBPARTITIONS 2 ( |
| 567 |
PARTITION p0 VALUES LESS THAN (10), |
| 568 |
PARTITION p1 VALUES LESS THAN (20), |
| 569 |
PARTITION p2 VALUES LESS THAN (30), |
| 570 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 571 |
); |
| 572 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp0 TABLESPACE; |
| 573 |
ALTER TABLE partitions.t5 DISCARD PARTITION p0sp1 TABLESPACE; |
| 574 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp0 TABLESPACE; |
| 575 |
ALTER TABLE partitions.t5 DISCARD PARTITION p1sp1 TABLESPACE; |
| 576 |
ALTER TABLE partitions.t5 DISCARD PARTITION p2sp0 TABLESPACE; |
| 577 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp0 TABLESPACE; |
| 578 |
ALTER TABLE partitions.t5 IMPORT PARTITION p0sp1 TABLESPACE; |
| 579 |
ALTER TABLE partitions.t5 IMPORT PARTITION p1sp0 TABLESPACE; |
| 580 |
ALTER TABLE partitions.t5 IMPORT PARTITION p2sp0 TABLESPACE; |
| 581 |
CREATE TABLE partitions.t6 (c1 INT, c2 INT) |
| 582 |
PARTITION BY RANGE( c2 ) |
| 583 |
SUBPARTITION BY HASH( c2 ) |
| 584 |
SUBPARTITIONS 2 ( |
| 585 |
PARTITION p0 VALUES LESS THAN (10), |
| 586 |
PARTITION p1 VALUES LESS THAN (20), |
| 587 |
PARTITION p2 VALUES LESS THAN (30), |
| 588 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 589 |
); |
| 590 |
ALTER TABLE partitions.t6 DISCARD PARTITION p0 TABLESPACE; |
| 591 |
ALTER TABLE partitions.t6 DISCARD PARTITION p1sp1 TABLESPACE; |
| 592 |
CREATE TABLE partitions.t7 (c1 INT, c2 INT) |
| 593 |
PARTITION BY RANGE( c2 ) |
| 594 |
SUBPARTITION BY HASH( c2 ) |
| 595 |
SUBPARTITIONS 2 ( |
| 596 |
PARTITION p0 VALUES LESS THAN (10), |
| 597 |
PARTITION p1 VALUES LESS THAN (20), |
| 598 |
PARTITION p2 VALUES LESS THAN (30), |
| 599 |
PARTITION p3 VALUES LESS THAN MAXVALUE |
| 600 |
); |
| 601 |
ALTER TABLE partitions.t7 DISCARD PARTITION p0 TABLESPACE; |
| 602 |
ALTER TABLE partitions.t7 DISCARD PARTITION p1sp0 TABLESPACE; |
| 603 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp0 TABLESPACE; |
| 604 |
ALTER TABLE partitions.t7 IMPORT PARTITION p0sp1 TABLESPACE; |
| 605 |
ALTER TABLE partitions.t7 IMPORT PARTITION p1sp0 TABLESPACE; |
| 606 |
ALTER TABLE partitions.t1 REBUILD PARTITION p0; |
| 607 |
ERROR HY000: Tablespace has been discarded for table 't1' |
| 608 |
# restart |
| 609 |
DROP TABLE partitions.t1; |
| 610 |
DROP TABLE partitions.t2; |
| 611 |
DROP TABLE partitions.t3; |
| 612 |
DROP TABLE partitions.t4; |
| 613 |
DROP TABLE partitions.t5; |
| 614 |
DROP TABLE partitions.t6; |
| 615 |
DROP TABLE partitions.t7; |
| 616 |
DROP DATABASE partitions; |