forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit096a761
committed
Fix ecpg's mechanism for detecting unsupported cases in the grammar.
ecpg wants to emit a warning if it parses a SQL construct that thebackend can parse but will immediately throw a FEATURE_NOT_SUPPORTEDerror for. The way it was testing for this was to see if the stringERRCODE_FEATURE_NOT_SUPPORTED appeared anywhere in the gram.y code.This is, of course, not nearly good enough, as there are plenty ofrules in gram.y that throw that error only conditionally. There wasa hack dating to 2008 to suppress the warning in one rule thatdoesn't even exist anymore, but nothing for other cases we've createdsince then. End result was that you could get "unsupported featurewill be passed to server" warnings while compiling perfectly good SQLcode in ecpg. Somehow we'd not heard complaints about this, butit was exposed by the recent addition of an ecpg test for a SQL/JSONconstruct.To fix, suppress the warning if the rule contains any "if" statement.Manual comparison of gram.y with the generated preproc.y file showsthat the warning is now emitted only in rules where it's sensible.This problem has existed for a long time, so back-patch to allsupported branches.Discussion:https://postgr.es/m/603615.1712245382@sss.pgh.pa.us1 parent332d406 commit096a761
1 file changed
+18
-19
lines changedLines changed: 18 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| |||
151 | 152 |
| |
152 | 153 |
| |
153 | 154 |
| |
154 |
| - | |
155 |
| - | |
156 |
| - | |
157 |
| - | |
158 |
| - | |
159 |
| - | |
160 | 155 |
| |
161 | 156 |
| |
162 | 157 |
| |
| |||
182 | 177 |
| |
183 | 178 |
| |
184 | 179 |
| |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
185 | 187 |
| |
186 | 188 |
| |
187 | 189 |
| |
| |||
541 | 543 |
| |
542 | 544 |
| |
543 | 545 |
| |
544 |
| - | |
| 546 | + | |
545 | 547 |
| |
546 |
| - | |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
556 |
| - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
557 | 554 |
| |
| 555 | + | |
| 556 | + | |
558 | 557 |
| |
559 | 558 |
| |
560 | 559 |
| |
|
0 commit comments
Comments
(0)