mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Added syntax and implementation for BACKUP STAGE's
Part of MDEV-5336 Implement LOCK FOR BACKUP - Changed check of Global_only_lock to also include BACKUP lock. - We store latest MDL_BACKUP_DDL lock in thd->mdl_backup_ticket to be able to downgrade lock during copy_data_between_tables()
This commit is contained in:
163
mysql-test/main/backup_syntax.result
Normal file
163
mysql-test/main/backup_syntax.result
Normal file
@ -0,0 +1,163 @@
|
||||
#-----------------------------------------------------------------------
|
||||
# Basic syntax checks
|
||||
#-----------------------------------------------------------------------
|
||||
# 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;
|
||||
# Check invalid variants of BACKUP .... syntax.
|
||||
BACKUP LOG;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOG' at line 1
|
||||
BACKUP LOCK;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOCK' at line 1
|
||||
BACKUP STAGE;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
|
||||
BACKUP STAGE LOCK;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LOCK' at line 1
|
||||
BACKUP STAGE not_existing;
|
||||
ERROR HY000: Unknown backup stage: 'not_existing'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or END
|
||||
#-----------------------------------------------------------------------
|
||||
# BACKUP STAGE statements in various orders.
|
||||
#-----------------------------------------------------------------------
|
||||
# All BACKUP STAGE statements != 'BACKUP STAGE START' expect that a
|
||||
# backup lock (generated by BACKUP STAGE START) already exists.
|
||||
#
|
||||
backup stage start;
|
||||
backup stage flush;
|
||||
backup stage start;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
|
||||
backup stage start;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
|
||||
backup stage block_commit;
|
||||
backup stage flush;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
backup stage flush;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
backup stage end;
|
||||
backup stage flush;
|
||||
ERROR HY000: You must start backup with "BACKUP STAGE START"
|
||||
BACKUP STAGE END;
|
||||
ERROR HY000: You must start backup with "BACKUP STAGE START"
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
ERROR HY000: You must start backup with "BACKUP STAGE START"
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
ERROR HY000: You must start backup with "BACKUP STAGE START"
|
||||
BACKUP STAGE FLUSH;
|
||||
ERROR HY000: You must start backup with "BACKUP STAGE START"
|
||||
# Ordered "give up" with 'BACKUP STAGE END' because of whatever reason.
|
||||
# Some existing backup lock assumed a 'BACKUP STAGE END' is allowed in
|
||||
# every situation.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE END;
|
||||
# Orders with BACKUP STAGE FLUSH omitted.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE END;
|
||||
# Orders with BACKUP STAGE BLOCK_DDL omitted.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE END;
|
||||
# Orders with BACKUP STAGE BLOCK_COMMIT omitted.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE END;
|
||||
# Orders with doubled BACKUP STAGE statements.
|
||||
# We get an error but that seems to have no bad impact on the state.
|
||||
# And so we are allowed to go on with BACKUP STAGE statements.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE START;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'START'
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE FLUSH;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'FLUSH'
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_DDL'
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
ERROR HY000: Backup stage 'BLOCK_COMMIT' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
BACKUP STAGE END;
|
||||
# Scrambled orders.
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE START;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE START;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'BLOCK_DDL'
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE START;
|
||||
ERROR HY000: Backup stage 'START' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE FLUSH;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_DDL'
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE FLUSH;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
BACKUP STAGE FLUSH;
|
||||
ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_DDL'
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE END;
|
||||
#----
|
||||
BACKUP STAGE START;
|
||||
BACKUP STAGE FLUSH;
|
||||
BACKUP STAGE BLOCK_COMMIT;
|
||||
BACKUP STAGE BLOCK_DDL;
|
||||
ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_COMMIT'
|
||||
BACKUP STAGE END;
|
||||
#
|
||||
# Check Oracle syntax
|
||||
#
|
||||
set SQL_MODE=Oracle;
|
||||
backup stage start;
|
||||
backup stage end;
|
||||
set SQL_MODE=default;
|
Reference in New Issue
Block a user