1drop table if exists t1;
2create table t1 (time time, date date, timestamp timestamp,
3quarter int, week int, year int, timestampadd int, timestampdiff int);
4insert into t1 values ("12:22:22","97:02:03","1997-01-02",1,2,3,4,5);
5select * from t1;
6time	date	timestamp	quarter	week	year	timestampadd	timestampdiff
712:22:22	1997-02-03	1997-01-02 00:00:00	1	2	3	4	5
8select t1.time+0,t1.date+0,t1.timestamp+0,concat(date," ",time),
9t1.quarter+t1.week, t1.year+timestampadd,  timestampdiff from t1;
10t1.time+0	t1.date+0	t1.timestamp+0	concat(date," ",time)	t1.quarter+t1.week	t1.year+timestampadd	timestampdiff
11122222	19970203	19970102000000	1997-02-03 12:22:22	3	7	5
12drop table t1;
13create table events(binlog int);
14insert into events values(1);
15select events.binlog from events;
16binlog
171
18drop table events;
19create procedure p1()
20begin
21declare n int default 2;
22authors: while n > 0 do
23set n = n -1;
24end while authors;
25end|
26create procedure p2()
27begin
28declare n int default 2;
29contributors: while n > 0 do
30set n = n -1;
31end while contributors;
32end|
33drop procedure p1;
34drop procedure p2;
35create table t1 (connection int, b int);
36create procedure p1()
37begin
38declare connection int;
39select max(t1.connection) into connection from t1;
40select concat("max=",connection) 'p1';
41end|
42insert into t1 (connection) values (1);
43call p1();
44p1
45max=1
46drop procedure p1;
47drop table t1;
48CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
49INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
50INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
51INSERT INTO slow(slow, general) VALUES (1,2), (5,6);
52INSERT INTO slow(slow) VALUES (1), (5);
53SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow;
54slow	general	master_heartbeat_period	ignore_server_ids
551	2	3	4
561	2	3	NULL
571	2	NULL	NULL
581	NULL	NULL	NULL
595	6	7	8
605	6	7	NULL
615	6	NULL	NULL
625	NULL	NULL	NULL
63SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow;
64slow	general	master_heartbeat_period
651	2	3
661	2	3
671	2	NULL
681	NULL	NULL
695	6	7
705	6	7
715	6	NULL
725	NULL	NULL
73SELECT slow, master_heartbeat_period FROM slow ORDER BY slow;
74slow	master_heartbeat_period
751	3
761	3
771	NULL
781	NULL
795	7
805	7
815	NULL
825	NULL
83SELECT slow FROM slow ORDER BY slow;
84slow
851
861
871
881
895
905
915
925
93DROP TABLE slow;
94CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
95INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
96INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
97INSERT INTO general(slow, general) VALUES (1,2), (5,6);
98INSERT INTO general(slow) VALUES (1), (5);
99SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow;
100slow	general	master_heartbeat_period	ignore_server_ids
1011	2	3	4
1021	2	3	NULL
1031	2	NULL	NULL
1041	NULL	NULL	NULL
1055	6	7	8
1065	6	7	NULL
1075	6	NULL	NULL
1085	NULL	NULL	NULL
109SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow;
110slow	general	master_heartbeat_period
1111	2	3
1121	2	3
1131	2	NULL
1141	NULL	NULL
1155	6	7
1165	6	7
1175	6	NULL
1185	NULL	NULL
119SELECT slow, master_heartbeat_period FROM general ORDER BY slow;
120slow	master_heartbeat_period
1211	3
1221	3
1231	NULL
1241	NULL
1255	7
1265	7
1275	NULL
1285	NULL
129SELECT slow FROM general ORDER BY slow;
130slow
1311
1321
1331
1341
1355
1365
1375
1385
139DROP TABLE general;
140CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
141INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
142INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
143INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6);
144INSERT INTO master_heartbeat_period(slow) VALUES (1), (5);
145SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow;
146slow	general	master_heartbeat_period	ignore_server_ids
1471	2	3	4
1481	2	3	NULL
1491	2	NULL	NULL
1501	NULL	NULL	NULL
1515	6	7	8
1525	6	7	NULL
1535	6	NULL	NULL
1545	NULL	NULL	NULL
155SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
156slow	general	master_heartbeat_period
1571	2	3
1581	2	3
1591	2	NULL
1601	NULL	NULL
1615	6	7
1625	6	7
1635	6	NULL
1645	NULL	NULL
165SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow;
166slow	master_heartbeat_period
1671	3
1681	3
1691	NULL
1701	NULL
1715	7
1725	7
1735	NULL
1745	NULL
175SELECT slow FROM master_heartbeat_period ORDER BY slow;
176slow
1771
1781
1791
1801
1815
1825
1835
1845
185DROP TABLE master_heartbeat_period;
186CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT);
187INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8);
188INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7);
189INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6);
190INSERT INTO ignore_server_ids(slow) VALUES (1), (5);
191SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow;
192slow	general	master_heartbeat_period	ignore_server_ids
1931	2	3	4
1941	2	3	NULL
1951	2	NULL	NULL
1961	NULL	NULL	NULL
1975	6	7	8
1985	6	7	NULL
1995	6	NULL	NULL
2005	NULL	NULL	NULL
201SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
202slow	general	master_heartbeat_period
2031	2	3
2041	2	3
2051	2	NULL
2061	NULL	NULL
2075	6	7
2085	6	7
2095	6	NULL
2105	NULL	NULL
211SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow;
212slow	master_heartbeat_period
2131	3
2141	3
2151	NULL
2161	NULL
2175	7
2185	7
2195	NULL
2205	NULL
221SELECT slow FROM ignore_server_ids ORDER BY slow;
222slow
2231
2241
2251
2261
2275
2285
2295
2305
231DROP TABLE ignore_server_ids;
232CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
233INSERT INTO t1 VALUES (1,2,3,4);
234CREATE PROCEDURE p1()
235BEGIN
236DECLARE slow INT;
237DECLARE general INT;
238DECLARE ignore_server_ids INT;
239DECLARE master_heartbeat_period INT;
240SELECT max(t1.slow) INTO slow FROM t1;
241SELECT max(t1.general) INTO general FROM t1;
242SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
243SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
244SELECT slow, general, ignore_server_ids, master_heartbeat_period;
245END|
246CREATE PROCEDURE p2()
247BEGIN
248DECLARE n INT DEFAULT 2;
249general: WHILE n > 0 DO
250SET n = n -1;
251END WHILE general;
252SET n = 2;
253slow: WHILE n > 0 DO
254SET n = n -1;
255END WHILE slow;
256SET n = 2;
257ignore_server_ids: WHILE n > 0 DO
258SET n = n -1;
259END WHILE ignore_server_ids;
260SET n = 2;
261master_heartbeat_period: WHILE n > 0 DO
262SET n = n -1;
263END WHILE master_heartbeat_period;
264END|
265CALL p1();
266slow	general	ignore_server_ids	master_heartbeat_period
2671	2	3	4
268call p2();
269DROP PROCEDURE p1;
270DROP PROCEDURE p2;
271DROP TABLE t1;
272create table option (option int not null);
273drop table option;
274set option=1;
275ERROR HY000: Unknown system variable 'option'
276set option option=1;
277ERROR 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 'option=1' at line 1
278#
279# MDEV-9979 Keywords UNBOUNDED, PRECEDING, FOLLOWING, TIES, OTHERS should be non-reserved
280#
281CREATE TABLE EXCLUDE (EXCLUDE INT);
282SELECT EXCLUDE FROM EXCLUDE;
283EXCLUDE
284SELECT EXCLUDE EXCLUDE FROM EXCLUDE;
285EXCLUDE
286SELECT EXCLUDE AS EXCLUDE FROM EXCLUDE;
287EXCLUDE
288DROP TABLE EXCLUDE;
289CREATE TABLE UNBOUNDED (UNBOUNDED INT);
290SELECT UNBOUNDED FROM UNBOUNDED;
291UNBOUNDED
292SELECT UNBOUNDED UNBOUNDEX FROM UNBOUNDED;
293UNBOUNDEX
294SELECT UNBOUNDED AS UNBOUNDEX FROM UNBOUNDED;
295UNBOUNDEX
296DROP TABLE UNBOUNDED;
297CREATE TABLE PRECEDING (PRECEDING INT);
298SELECT PRECEDING FROM PRECEDING;
299PRECEDING
300SELECT PRECEDING PRECEDING FROM PRECEDING;
301PRECEDING
302SELECT PRECEDING AS PRECEDING FROM PRECEDING;
303PRECEDING
304DROP TABLE PRECEDING;
305CREATE TABLE FOLLOWING (FOLLOWING INT);
306SELECT FOLLOWING FROM FOLLOWING;
307FOLLOWING
308SELECT FOLLOWING FOLLOWING FROM FOLLOWING;
309FOLLOWING
310SELECT FOLLOWING AS FOLLOWING FROM FOLLOWING;
311FOLLOWING
312DROP TABLE FOLLOWING;
313CREATE TABLE TIES (TIES INT);
314SELECT TIES FROM TIES;
315TIES
316SELECT TIES TIES FROM TIES;
317TIES
318SELECT TIES AS TIES FROM TIES;
319TIES
320DROP TABLE TIES;
321CREATE TABLE OTHERS (OTHERS INT);
322SELECT OTHERS FROM OTHERS;
323OTHERS
324SELECT OTHERS OTHERS FROM OTHERS;
325OTHERS
326SELECT OTHERS AS OTHERS FROM OTHERS;
327OTHERS
328DROP TABLE OTHERS;
329#
330# MDEV-10585 EXECUTE IMMEDIATE statement
331#
332CREATE TABLE immediate (immediate int);
333DROP TABLE immediate;
334#
335# MDEV-10142 Pluggable parser
336# Testing keywords that were added into lex.h for Oracle compatibility
337# that are not reserved keywords in MariaDB
338#
339CREATE TABLE clob (clob int);
340DROP TABLE clob;
341CREATE TABLE elsif (elsif INT);
342DROP TABLE elsif;
343CREATE TABLE exception (exception INT);
344DROP TABLE exception;
345CREATE TABLE raw (raw int);
346DROP TABLE raw;
347CREATE TABLE varchar2 (varchar2 int);
348DROP TABLE varchar2;
349CREATE TABLE decode (decode int);
350DROP TABLE decode;
351CREATE TABLE rowcount (rowcount int);
352DROP TABLE rowcount;
353CREATE TABLE isopen (isopen int);
354DROP TABLE isopen;
355CREATE TABLE notfound (notfound int);
356DROP TABLE notfound;
357CREATE TABLE raise (raise int);
358DROP TABLE raise;
359CREATE TABLE reuse (reuse int);
360DROP TABLE reuse;
361#
362# MDEV-17363 Compressed columns cannot be restored from dump
363# COMPRESSED is not valid as an SP label any more
364# but is still valid as an SP variable name.
365#
366BEGIN NOT ATOMIC
367compressed:
368BEGIN
369SELECT 1 AS a;
370END;
371END
372$$
373ERROR 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 'compressed:
374BEGIN
375SELECT 1 AS a;
376END;
377END' at line 2
378BEGIN NOT ATOMIC
379`compressed`:
380BEGIN
381SELECT 1 AS a;
382END;
383END
384$$
385a
3861
387BEGIN NOT ATOMIC
388DECLARE compressed INT DEFAULT 1;
389SELECT compressed;
390END
391$$
392compressed
3931
394