summaryrefslogtreecommitdiff
path: root/mysql-test/t/parser.test
blob: 02fe98dc7b28d741b262fdc52de870eda18cd4fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# This file contains tests covering the parser
#

#=============================================================================
# LEXICAL PARSER (lex)
#=============================================================================

#
# Maintainer: these tests are for the lexical parser, so every character,
# even whitespace or comments, is significant here.
#

#
# Bug#26030 (Parsing fails for stored routine w/multi-statement execution
# enabled)
#

--disable_warnings
DROP PROCEDURE IF EXISTS p26030;
--enable_warnings

delimiter $$;

select "non terminated"$$
select "terminated";$$
select "non terminated, space"      $$
select "terminated, space";      $$
select "non terminated, comment" /* comment */$$
select "terminated, comment"; /* comment */$$

# Multi queries can not be used in --ps-protocol test mode
--disable_ps_protocol

select "stmt 1";select "stmt 2 non terminated"$$
select "stmt 1";select "stmt 2 terminated";$$
select "stmt 1";select "stmt 2 non terminated, space"      $$
select "stmt 1";select "stmt 2 terminated, space";      $$
select "stmt 1";select "stmt 2 non terminated, comment" /* comment */$$
select "stmt 1";select "stmt 2 terminated, comment"; /* comment */$$

select "stmt 1";             select "space, stmt 2"$$
select "stmt 1";/* comment */select "comment, stmt 2"$$

DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() BEGIN SELECT 1; END; CALL p26030()
$$

DROP PROCEDURE IF EXISTS p26030; CREATE PROCEDURE p26030() SELECT 1; CALL p26030()
$$

--enable_ps_protocol

delimiter ;$$
DROP PROCEDURE p26030;

#============================================================================r
# SYNTACTIC PARSER (bison)
#=============================================================================