| 1 |
# |
| 2 |
# Check that you can specify ALGORITHM=[DEFAULT|COPY|INPLACE] for |
| 3 |
# ALTER TABLE ... REORGANIZE PARTITION |
| 4 |
# |
| 5 |
ALTER TABLE t1 |
| 6 |
algorithm=inplace, |
| 7 |
reorganize partition; |
| 8 |
ALTER TABLE t1 |
| 9 |
algorithm=copy, |
| 10 |
reorganize partition; |
| 11 |
ALTER TABLE t1 |
| 12 |
algorithm=default, |
| 13 |
reorganize partition; |
| 14 |
# |
| 15 |
# Check that REORGANIZE PARTITION by default is an inplace |
| 16 |
# operation by not allowing copying alter table and then running |
| 17 |
# a reorg. |
| 18 |
# |
| 19 |
set @@ndb_allow_copying_alter_table = 0; |
| 20 |
ALTER TABLE t1 |
| 21 |
reorganize partition; |
| 22 |
set @@ndb_allow_copying_alter_table = default; |
| 23 |
# |
| 24 |
# Check that REORGANIZE PARTITION works also when copying alter is |
| 25 |
# allowed (although it should ofcourse still use inplace per above test). |
| 26 |
# |
| 27 |
ALTER TABLE t1 |
| 28 |
reorganize partition; |
| 29 |
# |
| 30 |
# Check that inplace REORGANIZE PARTITION is not allowed on a |
| 31 |
# table with MAX_ROWS |
| 32 |
# |
| 33 |
ALTER TABLE t3 |
| 34 |
algorithm=inplace, |
| 35 |
reorganize partition; |
| 36 |
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: REORGANIZE of table with MAX_ROWS. Try ALGORITHM=COPY. |
| 37 |
# |
| 38 |
# Check that implicit copying REORGANIZE PARTITION is allowed on a |
| 39 |
# table with MAX_ROWS |
| 40 |
# |
| 41 |
ALTER TABLE t3 |
| 42 |
reorganize partition; |
| 43 |
# |
| 44 |
# Check that explicit copying REORGANIZE PARTITION is allowed on a |
| 45 |
# table with MAX_ROWS even when copying alter table is not allowed |
| 46 |
# |
| 47 |
set @@ndb_allow_copying_alter_table = 0; |
| 48 |
ALTER TABLE t3 |
| 49 |
algorithm=copy, |
| 50 |
reorganize partition; |
| 51 |
set @@ndb_allow_copying_alter_table = default; |
| 52 |
# |
| 53 |
# Check that implicit copying REORGANIZE PARTITION is prevented on a |
| 54 |
# table with MAX_ROWS when copying alter table is not allowed |
| 55 |
# |
| 56 |
set @@ndb_allow_copying_alter_table = 0; |
| 57 |
ALTER TABLE t3 |
| 58 |
reorganize partition; |
| 59 |
ERROR 0A000: Implicit copying alter is not supported. Reason: ndb_allow_copying_alter_table=0. Try ALGORITHM=COPY to force the alter. |
| 60 |
set @@ndb_allow_copying_alter_table = default; |
| 61 |
== verify_mysql_dd.inc == |