forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9e138a4
committed
Fix ecpg bugs caused by missing semicolons in the backend grammar.
The Bison documentation clearly states that a semicolon is requiredafter every grammar rule, and our scripts that generate ecpg'sgrammar from the backend's implicitly assumed this is true. But itturns out that only ancient versions of Bison actually enforce that.There have been a couple of rules without trailing semicolons ingram.y for some time, and as a consequence, ecpg's grammar was faultyand produced wrong output for the affected statements.To fix, add the missing semis, and add some cross-checks to ecpg'sscripts so that they'll bleat if we mess this up again.The cases that were broken were:* "SET variable = DEFAULT" (but not "SET variable TO DEFAULT"), as well as allied syntaxes such as ALTER SYSTEM SET ... DEFAULT. These produced syntactically invalid output that the server would reject.* Multiple type names in DROP TYPE/DOMAIN commands. Only the first type name would be listed in the emitted command.Per report from Daisuke Higuchi. Back-patch to all supported versions.Discussion:https://postgr.es/m/1803D792815FC24D871C00D17AE95905DB51CE@g01jpexmbkw241 parentf16735d commit9e138a4
File tree
3 files changed
+18
-1
lines changed- src
- backend/parser
- interfaces/ecpg/preproc
3 files changed
+18
-1
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1465 | 1465 |
| |
1466 | 1466 |
| |
1467 | 1467 |
| |
| 1468 | + | |
1468 | 1469 |
| |
1469 | 1470 |
| |
1470 | 1471 |
| |
| |||
6282 | 6283 |
| |
6283 | 6284 |
| |
6284 | 6285 |
| |
| 6286 | + | |
6285 | 6287 |
| |
6286 | 6288 |
| |
6287 | 6289 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
131 | 132 |
| |
132 | 133 |
| |
133 | 134 |
| |
| 135 | + | |
134 | 136 |
| |
135 | 137 |
| |
136 | 138 |
| |
137 | 139 |
| |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 |
| |
139 | 144 |
| |
140 | 145 |
| |
| |||
145 | 150 |
| |
146 | 151 |
| |
147 | 152 |
| |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 |
| |
149 | 157 |
| |
150 | 158 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
| |||
288 | 289 |
| |
289 | 290 |
| |
290 | 291 |
| |
| 292 | + | |
291 | 293 |
| |
292 | 294 |
| |
293 | 295 |
| |
| |||
365 | 367 |
| |
366 | 368 |
| |
367 | 369 |
| |
| 370 | + | |
| 371 | + | |
| 372 | + | |
368 | 373 |
| |
369 | 374 |
| |
370 | 375 |
| |
| |||
415 | 420 |
| |
416 | 421 |
| |
417 | 422 |
| |
| 423 | + | |
| 424 | + | |
418 | 425 |
| |
419 | 426 |
| |
420 | 427 |
| |
|
0 commit comments
Comments
(0)