1#-----------------------------------------------------------------------
2# Basic syntax checks
3#-----------------------------------------------------------------------
4# Check existing BACKUP STAGE statements in the sequence to be used.
5BACKUP STAGE START;
6BACKUP STAGE FLUSH;
7BACKUP STAGE BLOCK_DDL;
8BACKUP STAGE BLOCK_COMMIT;
9BACKUP STAGE END;
10# Check invalid variants of BACKUP .... syntax.
11BACKUP LOG;
12ERROR 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
13BACKUP LOCK;
14ERROR 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
15BACKUP STAGE;
16ERROR 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
17BACKUP STAGE LOCK;
18ERROR 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
19BACKUP STAGE not_existing;
20ERROR HY000: Unknown backup stage: 'not_existing'. Stage should be one of START, FLUSH, BLOCK_DDL, BLOCK_COMMIT or END
21#-----------------------------------------------------------------------
22# BACKUP STAGE statements in various orders.
23#-----------------------------------------------------------------------
24# All BACKUP STAGE statements != 'BACKUP STAGE START' expect that a
25# backup lock (generated by BACKUP STAGE START) already exists.
26#
27backup stage start;
28backup stage flush;
29backup stage start;
30ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
31backup stage start;
32ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
33backup stage block_commit;
34backup stage flush;
35ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
36backup stage flush;
37ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
38backup stage end;
39backup stage flush;
40ERROR HY000: You must start backup with "BACKUP STAGE START"
41BACKUP STAGE END;
42ERROR HY000: You must start backup with "BACKUP STAGE START"
43BACKUP STAGE BLOCK_COMMIT;
44ERROR HY000: You must start backup with "BACKUP STAGE START"
45BACKUP STAGE BLOCK_DDL;
46ERROR HY000: You must start backup with "BACKUP STAGE START"
47BACKUP STAGE FLUSH;
48ERROR HY000: You must start backup with "BACKUP STAGE START"
49# Ordered "give up" with 'BACKUP STAGE END' because of whatever reason.
50# Some existing backup lock assumed a 'BACKUP STAGE END' is allowed in
51# every situation.
52BACKUP STAGE START;
53BACKUP STAGE END;
54#----
55BACKUP STAGE START;
56BACKUP STAGE FLUSH;
57BACKUP STAGE END;
58#----
59BACKUP STAGE START;
60BACKUP STAGE FLUSH;
61BACKUP STAGE BLOCK_DDL;
62BACKUP STAGE END;
63# Orders with BACKUP STAGE FLUSH omitted.
64BACKUP STAGE START;
65BACKUP STAGE BLOCK_DDL;
66BACKUP STAGE END;
67#----
68BACKUP STAGE START;
69BACKUP STAGE BLOCK_DDL;
70BACKUP STAGE BLOCK_COMMIT;
71BACKUP STAGE END;
72# Orders with BACKUP STAGE BLOCK_DDL omitted.
73BACKUP STAGE START;
74BACKUP STAGE FLUSH;
75BACKUP STAGE BLOCK_COMMIT;
76BACKUP STAGE END;
77# Orders with BACKUP STAGE BLOCK_COMMIT omitted.
78BACKUP STAGE START;
79BACKUP STAGE FLUSH;
80BACKUP STAGE BLOCK_DDL;
81BACKUP STAGE END;
82# Orders with doubled BACKUP STAGE statements.
83# We get an error but that seems to have no bad impact on the state.
84# And so we are allowed to go on with BACKUP STAGE statements.
85BACKUP STAGE START;
86BACKUP STAGE START;
87ERROR HY000: Backup stage 'START' is same or before current backup stage 'START'
88BACKUP STAGE FLUSH;
89BACKUP STAGE BLOCK_DDL;
90BACKUP STAGE BLOCK_COMMIT;
91BACKUP STAGE END;
92#----
93BACKUP STAGE START;
94BACKUP STAGE FLUSH;
95BACKUP STAGE FLUSH;
96ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'FLUSH'
97BACKUP STAGE END;
98#----
99BACKUP STAGE START;
100BACKUP STAGE FLUSH;
101BACKUP STAGE BLOCK_DDL;
102BACKUP STAGE BLOCK_DDL;
103ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_DDL'
104BACKUP STAGE END;
105#----
106BACKUP STAGE START;
107BACKUP STAGE FLUSH;
108BACKUP STAGE BLOCK_DDL;
109BACKUP STAGE BLOCK_COMMIT;
110BACKUP STAGE BLOCK_COMMIT;
111ERROR HY000: Backup stage 'BLOCK_COMMIT' is same or before current backup stage 'BLOCK_COMMIT'
112BACKUP STAGE END;
113# Scrambled orders.
114BACKUP STAGE START;
115BACKUP STAGE FLUSH;
116BACKUP STAGE START;
117ERROR HY000: Backup stage 'START' is same or before current backup stage 'FLUSH'
118BACKUP STAGE BLOCK_DDL;
119BACKUP STAGE START;
120ERROR HY000: Backup stage 'START' is same or before current backup stage 'BLOCK_DDL'
121BACKUP STAGE BLOCK_COMMIT;
122BACKUP STAGE START;
123ERROR HY000: Backup stage 'START' is same or before current backup stage 'BLOCK_COMMIT'
124BACKUP STAGE END;
125#----
126BACKUP STAGE START;
127BACKUP STAGE FLUSH;
128BACKUP STAGE BLOCK_DDL;
129BACKUP STAGE FLUSH;
130ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_DDL'
131BACKUP STAGE BLOCK_COMMIT;
132BACKUP STAGE FLUSH;
133ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_COMMIT'
134BACKUP STAGE END;
135#----
136BACKUP STAGE START;
137BACKUP STAGE FLUSH;
138BACKUP STAGE BLOCK_DDL;
139BACKUP STAGE BLOCK_COMMIT;
140BACKUP STAGE BLOCK_DDL;
141ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_COMMIT'
142BACKUP STAGE END;
143#----
144BACKUP STAGE START;
145BACKUP STAGE BLOCK_DDL;
146BACKUP STAGE FLUSH;
147ERROR HY000: Backup stage 'FLUSH' is same or before current backup stage 'BLOCK_DDL'
148BACKUP STAGE BLOCK_COMMIT;
149BACKUP STAGE END;
150#----
151BACKUP STAGE START;
152BACKUP STAGE FLUSH;
153BACKUP STAGE BLOCK_COMMIT;
154BACKUP STAGE BLOCK_DDL;
155ERROR HY000: Backup stage 'BLOCK_DDL' is same or before current backup stage 'BLOCK_COMMIT'
156BACKUP STAGE END;
157#
158# Check Oracle syntax
159#
160set SQL_MODE=Oracle;
161backup stage start;
162backup stage end;
163set SQL_MODE=default;
164