mariadb/mysql-test/main/backup_syntax.test
Otto Kekalainen 50c8ef01fc Fix trivial spelling errors
- agressively -> aggressively
- exising -> existing
- occured -> occurred
- releated -> related
- seperated -> separated
- sucess -> success
- use use -> use

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2023-03-24 12:54:05 +11:00

181 lines
4.5 KiB
Text

########################################################################
# Tests things related to syntax of BACKUP STAGE (MDEV-5336)
########################################################################
--source include/have_innodb.inc
--source include/have_metadata_lock_info.inc
--echo #-----------------------------------------------------------------------
--echo # Basic syntax checks
--echo #-----------------------------------------------------------------------
--echo # Check existing BACKUP STAGE statements in the sequence to be used.
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo # Check invalid variants of BACKUP .... syntax.
--error ER_PARSE_ERROR
BACKUP LOG;
--error ER_PARSE_ERROR
BACKUP LOCK;
--error ER_PARSE_ERROR
BACKUP STAGE;
--error ER_PARSE_ERROR
BACKUP STAGE LOCK;
--error ER_BACKUP_UNKNOWN_STAGE
BACKUP STAGE not_existing;
--echo #-----------------------------------------------------------------------
--echo # BACKUP STAGE statements in various orders.
--echo #-----------------------------------------------------------------------
--echo # All BACKUP STAGE statements != 'BACKUP STAGE START' expect that a
--echo # backup lock (generated by BACKUP STAGE START) already exists.
--echo #
backup stage start;
backup stage flush;
--error ER_BACKUP_WRONG_STAGE
backup stage start;
--error ER_BACKUP_WRONG_STAGE
backup stage start;
backup stage block_commit;
--error ER_BACKUP_WRONG_STAGE
backup stage flush;
--error ER_BACKUP_WRONG_STAGE
backup stage flush;
backup stage end;
--error ER_BACKUP_NOT_RUNNING
backup stage flush;
--error ER_BACKUP_NOT_RUNNING
BACKUP STAGE END;
--error ER_BACKUP_NOT_RUNNING
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_NOT_RUNNING
BACKUP STAGE BLOCK_DDL;
--error ER_BACKUP_NOT_RUNNING
BACKUP STAGE FLUSH;
--echo # Ordered "give up" with 'BACKUP STAGE END' because of whatever reason.
--echo # Some existing backup lock assumed a 'BACKUP STAGE END' is allowed in
--echo # every situation.
BACKUP STAGE START;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo # Orders with BACKUP STAGE FLUSH omitted.
BACKUP STAGE START;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo # Orders with BACKUP STAGE BLOCK_DDL omitted.
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo # Orders with BACKUP STAGE BLOCK_COMMIT omitted.
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo # Orders with doubled BACKUP STAGE statements.
--echo # We get an error but that seems to have no bad impact on the state.
--echo # And so we are allowed to go on with BACKUP STAGE statements.
BACKUP STAGE START;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE FLUSH;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo # Scrambled orders.
BACKUP STAGE START;
BACKUP STAGE FLUSH;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE START;
BACKUP STAGE BLOCK_DDL;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE START;
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE START;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE FLUSH;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE BLOCK_DDL;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_COMMIT;
BACKUP STAGE END;
--echo #----
BACKUP STAGE START;
BACKUP STAGE FLUSH;
BACKUP STAGE BLOCK_COMMIT;
--error ER_BACKUP_WRONG_STAGE
BACKUP STAGE BLOCK_DDL;
BACKUP STAGE END;
--echo #
--echo # Check Oracle syntax
--echo #
set SQL_MODE=Oracle;
backup stage start;
backup stage end;
set SQL_MODE=default;