| 1 |
if (!$query) |
| 2 |
{ |
| 3 |
die Need the query to test with provided in $query; |
| 4 |
} |
| 5 |
|
| 6 |
|
| 7 |
# |
| 8 |
# Check the current limitation in MySQL that you can't specify |
| 9 |
# ALGORITHM=[DEFAULT|COPY|INPLACE] with a comma afterwards for certain |
| 10 |
# partition management commands. Verify that this claim is |
| 11 |
# true for the current query and such an ALTER fails with syntax error. |
| 12 |
# |
| 13 |
let $syntax_error_query = |
| 14 |
`select REPLACE('$query', 't1', 't1 ALGORITHM=INPLACE,')`; |
| 15 |
#echo $syntax_error_query; |
| 16 |
|
| 17 |
--error ER_PARSE_ERROR |
| 18 |
eval $syntax_error_query; |
| 19 |
|
| 20 |
|
| 21 |
# |
| 22 |
# Check that you can specify ALGORITHM=INPLACE |
| 23 |
# without comma even if INPLACE is not supported |
| 24 |
# |
| 25 |
let $inplace_query = |
| 26 |
`select REPLACE('$query', 't1', 't1 ALGORITHM=INPLACE')`; |
| 27 |
#echo $inplace_query; |
| 28 |
|
| 29 |
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON |
| 30 |
eval $inplace_query; |
| 31 |
|
| 32 |
|
| 33 |
# |
| 34 |
# Check that you can specify ALGORITHM=COPY |
| 35 |
# and that copying alter is suported |
| 36 |
# |
| 37 |
let $copying_query = |
| 38 |
`select REPLACE('$query', 't1', 't1 ALGORITHM=COPY')`; |
| 39 |
#echo $copying_query; |
| 40 |
|
| 41 |
eval $copying_query; |
| 42 |
|
| 43 |
|
| 44 |
# |
| 45 |
# Check that the query performs copying ALTER |
| 46 |
# when not specifying any ALGORITHM= |
| 47 |
# |
| 48 |
eval $query; |
| 49 |
|
| 50 |
# Reset parameters which should change between each invocation |
| 51 |
let $query =; |
| 52 |
|