Skip to content

Commit 43b1207

Browse files
committed
Add test for condition 0
Signed-off-by: Maximilian Krög <[email protected]>
1 parent f136374 commit 43b1207

File tree

2 files changed

+197
-0
lines changed

2 files changed

+197
-0
lines changed

tests/data/parser/parseWhere0.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DELETE FROM t where 0 AND 0

tests/data/parser/parseWhere0.out

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
{
2+
"query": "DELETE FROM t where 0 AND 0",
3+
"lexer": {
4+
"@type": "PhpMyAdmin\\SqlParser\\Lexer",
5+
"str": "DELETE FROM t where 0 AND 0",
6+
"len": 27,
7+
"last": 27,
8+
"list": {
9+
"@type": "PhpMyAdmin\\SqlParser\\TokensList",
10+
"tokens": [
11+
{
12+
"@type": "PhpMyAdmin\\SqlParser\\Token",
13+
"token": "DELETE",
14+
"value": "DELETE",
15+
"keyword": "DELETE",
16+
"type": 1,
17+
"flags": 3,
18+
"position": 0
19+
},
20+
{
21+
"@type": "PhpMyAdmin\\SqlParser\\Token",
22+
"token": " ",
23+
"value": " ",
24+
"keyword": null,
25+
"type": 3,
26+
"flags": 0,
27+
"position": 6
28+
},
29+
{
30+
"@type": "PhpMyAdmin\\SqlParser\\Token",
31+
"token": "FROM",
32+
"value": "FROM",
33+
"keyword": "FROM",
34+
"type": 1,
35+
"flags": 3,
36+
"position": 7
37+
},
38+
{
39+
"@type": "PhpMyAdmin\\SqlParser\\Token",
40+
"token": " ",
41+
"value": " ",
42+
"keyword": null,
43+
"type": 3,
44+
"flags": 0,
45+
"position": 11
46+
},
47+
{
48+
"@type": "PhpMyAdmin\\SqlParser\\Token",
49+
"token": "t",
50+
"value": "t",
51+
"keyword": null,
52+
"type": 0,
53+
"flags": 0,
54+
"position": 12
55+
},
56+
{
57+
"@type": "PhpMyAdmin\\SqlParser\\Token",
58+
"token": " ",
59+
"value": " ",
60+
"keyword": null,
61+
"type": 3,
62+
"flags": 0,
63+
"position": 13
64+
},
65+
{
66+
"@type": "PhpMyAdmin\\SqlParser\\Token",
67+
"token": "where",
68+
"value": "WHERE",
69+
"keyword": "WHERE",
70+
"type": 1,
71+
"flags": 3,
72+
"position": 14
73+
},
74+
{
75+
"@type": "PhpMyAdmin\\SqlParser\\Token",
76+
"token": " ",
77+
"value": " ",
78+
"keyword": null,
79+
"type": 3,
80+
"flags": 0,
81+
"position": 19
82+
},
83+
{
84+
"@type": "PhpMyAdmin\\SqlParser\\Token",
85+
"token": "0",
86+
"value": 0,
87+
"keyword": null,
88+
"type": 6,
89+
"flags": 0,
90+
"position": 20
91+
},
92+
{
93+
"@type": "PhpMyAdmin\\SqlParser\\Token",
94+
"token": " ",
95+
"value": " ",
96+
"keyword": null,
97+
"type": 3,
98+
"flags": 0,
99+
"position": 21
100+
},
101+
{
102+
"@type": "PhpMyAdmin\\SqlParser\\Token",
103+
"token": "AND",
104+
"value": "AND",
105+
"keyword": "AND",
106+
"type": 1,
107+
"flags": 3,
108+
"position": 22
109+
},
110+
{
111+
"@type": "PhpMyAdmin\\SqlParser\\Token",
112+
"token": " ",
113+
"value": " ",
114+
"keyword": null,
115+
"type": 3,
116+
"flags": 0,
117+
"position": 25
118+
},
119+
{
120+
"@type": "PhpMyAdmin\\SqlParser\\Token",
121+
"token": "0",
122+
"value": 0,
123+
"keyword": null,
124+
"type": 6,
125+
"flags": 0,
126+
"position": 26
127+
},
128+
{
129+
"@type": "PhpMyAdmin\\SqlParser\\Token",
130+
"token": null,
131+
"value": null,
132+
"keyword": null,
133+
"type": 9,
134+
"flags": 0,
135+
"position": null
136+
}
137+
],
138+
"count": 14,
139+
"idx": 14
140+
},
141+
"delimiter": ";",
142+
"delimiterLen": 1,
143+
"strict": false,
144+
"errors": []
145+
},
146+
"parser": {
147+
"@type": "PhpMyAdmin\\SqlParser\\Parser",
148+
"list": {
149+
"@type": "@1"
150+
},
151+
"statements": [
152+
{
153+
"@type": "PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement",
154+
"from": [
155+
{
156+
"@type": "PhpMyAdmin\\SqlParser\\Components\\Expression",
157+
"database": null,
158+
"table": "t",
159+
"column": null,
160+
"expr": "t",
161+
"alias": null,
162+
"function": null,
163+
"subquery": null
164+
}
165+
],
166+
"join": null,
167+
"using": null,
168+
"columns": null,
169+
"partition": null,
170+
"where": [
171+
{
172+
"@type": "PhpMyAdmin\\SqlParser\\Components\\Condition",
173+
"identifiers": [],
174+
"isOperator": true,
175+
"expr": "AND"
176+
}
177+
],
178+
"order": null,
179+
"limit": null,
180+
"options": {
181+
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
182+
"options": []
183+
},
184+
"first": 0,
185+
"last": 12
186+
}
187+
],
188+
"brackets": 0,
189+
"strict": false,
190+
"errors": []
191+
},
192+
"errors": {
193+
"lexer": [],
194+
"parser": []
195+
}
196+
}

0 commit comments

Comments
 (0)