-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathparse_pass.sql
More file actions
187 lines (187 loc) · 8.72 KB
/
Copy pathparse_pass.sql
File metadata and controls
187 lines (187 loc) · 8.72 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
select 1 from t
select .1 from t
select 1.2e1 from t
select 1.2e+1 from t
select 1.2e-1 from t
select 08.3 from t
select -1 from t where b = -2
select 1 from t // aa#select 1 from t
select 1 from t -- aa#select 1 from t
select /* simplest */ 1 from t
select /* double star **/ 1 from t
select /* double */ /* comment */ 1 from t
select /* back-quote */ 1 from `t`#select /* back-quote */ 1 from t
select /* back-quote keyword */ 1 from `from`#select /* back-quote keyword */ 1 from `from`
select /* @ */ @@a from b
select /* \0 */ '\0' from a
select 1 /* drop this comment */ from t#select 1 from t
select /* union */ 1 from t union select 1 from t
select /* double union */ 1 from t union select 1 from t union select 1 from t
select /* union all */ 1 from t union all select 1 from t
select /* minus */ 1 from t minus select 1 from t
select /* except */ 1 from t except select 1 from t
select /* intersect */ 1 from t intersect select 1 from t
select /* distinct */ distinct 1 from t
select /* for update */ 1 from t for update
select /* lock in share mode */ 1 from t lock in share mode
select /* select list */ 1, 2 from t
select /* * */ * from t
select /* column alias */ a b from t#select /* column alias */ a as b from t
select /* column alias with as */ a as b from t
select /* a.* */ a.* from t
select /* select with bool expr */ a = b from t
select /* case_when */ case when a = b then c end from t
select /* case_when_else */ case when a = b then c else d end from t
select /* case_when_when_else */ case when a = b then c when b = d then d else d end from t
select /* case */ case aa when a = b then c end from t
select /* parenthesis */ 1 from (t)
select /* table list */ 1 from t1, t2
select /* parenthessis in table list 1 */ 1 from (t1), t2
select /* parenthessis in table list 2 */ 1 from t1, (t2)
select /* use */ 1 from t1 use index (a) where b = 1
select /* ignore */ 1 from t1 as t2 ignore index (a), t3 use index (b) where b = 1
select /* use */ 1 from t1 as t2 use index (a), t3 use index (b) where b = 1
select /* force */ 1 from t1 as t2 force index (a), t3 force index (b) where b = 1
select /* table alias */ 1 from t t1#select /* table alias */ 1 from t as t1
select /* table alias with as */ 1 from t as t1
select /* join */ 1 from t1 join t2
select /* straight_join */ 1 from t1 straight_join t2
select /* left join */ 1 from t1 left join t2
select /* left outer join */ 1 from t1 left outer join t2#select /* left outer join */ 1 from t1 left join t2
select /* right join */ 1 from t1 right join t2
select /* right outer join */ 1 from t1 right outer join t2#select /* right outer join */ 1 from t1 right join t2
select /* inner join */ 1 from t1 inner join t2#select /* inner join */ 1 from t1 join t2
select /* cross join */ 1 from t1 cross join t2
select /* natural join */ 1 from t1 natural join t2
select /* join on */ 1 from t1 join t2 on a = b
select /* s.t */ 1 from s.t
select /* select in from */ 1 from (select 1 from t)
select /* where */ 1 from t where a = b
select /* and */ 1 from t where a = b and a = c
select /* or */ 1 from t where a = b or a = c
select /* not */ 1 from t where not a = b
select /* exists */ 1 from t where exists (select 1 from t)
select /* keyrange */ 1 from t where keyrange(1, 2)
select /* (boolean) */ 1 from t where not (a = b)
select /* in value list */ 1 from t where a in (b, c)
select /* in select */ 1 from t where a in (select 1 from t)
select /* not in */ 1 from t where a not in (b, c)
select /* like */ 1 from t where a like b
select /* not like */ 1 from t where a not like b
select /* between */ 1 from t where a between b and c
select /* not between */ 1 from t where a not between b and c
select /* is null */ 1 from t where a is null
select /* is not null */ 1 from t where a is not null
select /* < */ 1 from t where a < b
select /* <= */ 1 from t where a <= b
select /* >= */ 1 from t where a >= b
select /* <> */ 1 from t where a != b
select /* <=> */ 1 from t where a <=> b
select /* != */ 1 from t where a != b
select /* single value expre list */ 1 from t where a in (b)
select /* select as a value expression */ 1 from t where a = (select a from t)
select /* parenthesised value */ 1 from t where a = (b)
select /* over-parenthesize */ ((1)) from t where ((a)) in (((1))) and ((a, b)) in ((((1, 1))), ((2, 2)))
select /* dot-parenthesize */ (a.b) from t where (b.c) = 2
select /* & */ 1 from t where a = b&c
select /* | */ 1 from t where a = b|c
select /* ^ */ 1 from t where a = b^c
select /* + */ 1 from t where a = b+c
select /* - */ 1 from t where a = b-c
select /* * */ 1 from t where a = b*c
select /* / */ 1 from t where a = b/c
select /* % */ 1 from t where a = b%c
select /* u+ */ 1 from t where a = +b
select /* u- */ 1 from t where a = -b
select /* u~ */ 1 from t where a = ~b
select /* empty function */ 1 from t where a = b()
select /* function with 1 param */ 1 from t where a = b(c)
select /* function with many params */ 1 from t where a = b(c, d)
select /* if as func */ 1 from t where a = if(b)
select /* function with distinct */ count(distinct a) from t
select /* a */ a from t
select /* a.b */ a.b from t
select /* string */ 'a' from t
select /* double quoted string */ "a" from t#select /* double quoted string */ 'a' from t
select /* quote quote in string */ 'a''a' from t#select /* quote quote in string */ 'a\'a' from t
select /* double quote quote in string */ "a""a" from t#select /* double quote quote in string */ 'a\"a' from t
select /* quote in double quoted string */ "a'a" from t#select /* quote in double quoted string */ 'a\'a' from t
select /* backslash quote in string */ 'a\'a' from t
select /* literal backslash in string */ 'a\\na' from t
select /* all escapes */ '\0\'\"\b\n\r\t\Z\\' from t
select /* non-escape */ '\x' from t#select /* non-escape */ 'x' from t
select /* unescaped backslash */ '\n' from t
select /* value argument */ :a from t
select /* value argument with digit */ :a1 from t
select /* value argument with dot */ :a.b from t
select /* positional argument */ ? from t#select /* positional argument */ :v1 from t
select /* multiple positional arguments */ ?, ? from t#select /* multiple positional arguments */ :v1, :v2 from t
select /* list arg */ * from t where a in ::list
select /* list arg not in */ * from t where a not in ::list
select /* null */ null from t
select /* octal */ 010 from t
select /* hex */ 0xf0 from t
select /* hex caps */ 0xF0 from t
select /* float */ 0.1 from t
select /* group by */ 1 from t group by a
select /* having */ 1 from t having a = b
select /* simple order by */ 1 from t order by a#select /* simple order by */ 1 from t order by a asc
select /* order by asc */ 1 from t order by a asc
select /* order by desc */ 1 from t order by a desc
select /* limit a */ 1 from t limit a
select /* limit a,b */ 1 from t limit a, b
insert /* simple */ into a values (1)
insert /* a.b */ into a.b values (1)
insert /* multi-value */ into a values (1, 2)
insert /* multi-value list */ into a values (1, 2), (3, 4)
insert /* set */ into a set a = 1, a.b = 2#insert /* set */ into a(a, a.b) values (1, 2)
insert /* value expression list */ into a values (a+1, 2*3)
insert /* column list */ into a(a, b) values (1, 2)
insert /* qualified column list */ into a(a, a.b) values (1, 2)
insert /* select */ into a select b, c from d
insert /* on duplicate */ into a values (1, 2) on duplicate key update b = values(a), c = d
update /* simple */ a set b = 3
update /* a.b */ a.b set b = 3
update /* b.c */ a set b.c = 3
update /* list */ a set b = 3, c = 4
update /* expression */ a set b = 3+4
update /* where */ a set b = 3 where a = b
update /* order */ a set b = 3 order by c desc
update /* limit */ a set b = 3 limit c
delete /* simple */ from a
delete /* a.b */ from a.b
delete /* where */ from a where a = b
delete /* order */ from a order by b desc
delete /* limit */ from a limit b
set /* simple */ a = 3
set /* list */ a = 3, b = 4
alter ignore table a add foo#alter table a
alter table a add foo#alter table a
alter table a alter foo#alter table a
alter table a change foo#alter table a
alter table a modify foo#alter table a
alter table a drop foo#alter table a
alter table a disable foo#alter table a
alter table a enable foo#alter table a
alter table a order foo#alter table a
alter table a default foo#alter table a
alter table a discard foo#alter table a
alter table a import foo#alter table a
alter table a rename b#rename table a b
alter table a rename to b#rename table a b
create table a
create table if not exists a#create table a
create index a on b#alter table b
create unique index a on b#alter table b
create unique index a using foo on b#alter table b
create view a#create table a
alter view a#alter table a
drop view a#drop table a
drop table a
drop table if exists a#drop table a
drop view if exists a#drop table a
drop index b on a#alter table a
analyze table a#alter table a
show foobar#other
describe foobar#other
explain foobar#other