Skip to content

Commit a204ecd

Browse files
committed
Add test for SET variable = ON (#627)
1 parent 0bd40a6 commit a204ecd

3 files changed

Lines changed: 194 additions & 0 deletions

File tree

‎tests/Parser/SetStatementTest.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public static function setProvider(): array
3434
['parser/parseSetVariable'],
3535
['parser/parseSetVariable2'],
3636
['parser/parseSetGlobalVariable'],
37+
['parser/parseSetVariableOn'],
3738
];
3839
}
3940
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SET @@sql_log_bin = ON, autocommit = OFF
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
{
2+
"query": "SET @@sql_log_bin = ON, autocommit = OFF",
3+
"lexer": {
4+
"@type": "PhpMyAdmin\\SqlParser\\Lexer",
5+
"str": "SET @@sql_log_bin = ON, autocommit = OFF",
6+
"len": 40,
7+
"last": 40,
8+
"list": {
9+
"@type": "PhpMyAdmin\\SqlParser\\TokensList",
10+
"tokens": [
11+
{
12+
"@type": "PhpMyAdmin\\SqlParser\\Token",
13+
"token": "SET",
14+
"value": "SET",
15+
"keyword": "SET",
16+
"type": 1,
17+
"flags": 11,
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": 3
28+
},
29+
{
30+
"@type": "PhpMyAdmin\\SqlParser\\Token",
31+
"token": "@@sql_log_bin",
32+
"value": "sql_log_bin",
33+
"keyword": null,
34+
"type": 8,
35+
"flags": 9,
36+
"position": 4
37+
},
38+
{
39+
"@type": "PhpMyAdmin\\SqlParser\\Token",
40+
"token": " ",
41+
"value": " ",
42+
"keyword": null,
43+
"type": 3,
44+
"flags": 0,
45+
"position": 17
46+
},
47+
{
48+
"@type": "PhpMyAdmin\\SqlParser\\Token",
49+
"token": "=",
50+
"value": "=",
51+
"keyword": null,
52+
"type": 2,
53+
"flags": 2,
54+
"position": 18
55+
},
56+
{
57+
"@type": "PhpMyAdmin\\SqlParser\\Token",
58+
"token": " ",
59+
"value": " ",
60+
"keyword": null,
61+
"type": 3,
62+
"flags": 0,
63+
"position": 19
64+
},
65+
{
66+
"@type": "PhpMyAdmin\\SqlParser\\Token",
67+
"token": "ON",
68+
"value": "ON",
69+
"keyword": "ON",
70+
"type": 1,
71+
"flags": 3,
72+
"position": 20
73+
},
74+
{
75+
"@type": "PhpMyAdmin\\SqlParser\\Token",
76+
"token": ",",
77+
"value": ",",
78+
"keyword": null,
79+
"type": 2,
80+
"flags": 16,
81+
"position": 22
82+
},
83+
{
84+
"@type": "PhpMyAdmin\\SqlParser\\Token",
85+
"token": " ",
86+
"value": " ",
87+
"keyword": null,
88+
"type": 3,
89+
"flags": 0,
90+
"position": 23
91+
},
92+
{
93+
"@type": "PhpMyAdmin\\SqlParser\\Token",
94+
"token": "autocommit",
95+
"value": "autocommit",
96+
"keyword": null,
97+
"type": 0,
98+
"flags": 0,
99+
"position": 24
100+
},
101+
{
102+
"@type": "PhpMyAdmin\\SqlParser\\Token",
103+
"token": " ",
104+
"value": " ",
105+
"keyword": null,
106+
"type": 3,
107+
"flags": 0,
108+
"position": 34
109+
},
110+
{
111+
"@type": "PhpMyAdmin\\SqlParser\\Token",
112+
"token": "=",
113+
"value": "=",
114+
"keyword": null,
115+
"type": 2,
116+
"flags": 2,
117+
"position": 35
118+
},
119+
{
120+
"@type": "PhpMyAdmin\\SqlParser\\Token",
121+
"token": " ",
122+
"value": " ",
123+
"keyword": null,
124+
"type": 3,
125+
"flags": 0,
126+
"position": 36
127+
},
128+
{
129+
"@type": "PhpMyAdmin\\SqlParser\\Token",
130+
"token": "OFF",
131+
"value": "OFF",
132+
"keyword": null,
133+
"type": 0,
134+
"flags": 0,
135+
"position": 37
136+
},
137+
{
138+
"@type": "PhpMyAdmin\\SqlParser\\Token",
139+
"token": null,
140+
"value": null,
141+
"keyword": null,
142+
"type": 9,
143+
"flags": 0,
144+
"position": null
145+
}
146+
],
147+
"count": 15,
148+
"idx": 15
149+
},
150+
"delimiter": ";",
151+
"delimiterLen": 1,
152+
"strict": false,
153+
"errors": []
154+
},
155+
"parser": {
156+
"@type": "PhpMyAdmin\\SqlParser\\Parser",
157+
"list": {
158+
"@type": "@1"
159+
},
160+
"statements": [
161+
{
162+
"@type": "PhpMyAdmin\\SqlParser\\Statements\\SetStatement",
163+
"options": {
164+
"@type": "PhpMyAdmin\\SqlParser\\Components\\OptionsArray",
165+
"options": []
166+
},
167+
"end_options": null,
168+
"set": [
169+
{
170+
"@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation",
171+
"column": "@@sql_log_bin",
172+
"value": "ON"
173+
},
174+
{
175+
"@type": "PhpMyAdmin\\SqlParser\\Components\\SetOperation",
176+
"column": "autocommit",
177+
"value": "OFF"
178+
}
179+
],
180+
"first": 0,
181+
"last": 13
182+
}
183+
],
184+
"brackets": 0,
185+
"strict": false,
186+
"errors": []
187+
},
188+
"errors": {
189+
"lexer": [],
190+
"parser": []
191+
}
192+
}

0 commit comments

Comments
 (0)