forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb57b0e0
committed
The first fix is to allow an input file with a relative path and without
a ".pgc " extension. The second patch fixes a coredump when there ismore than one input file (in that case, cur and types were not set toNULL before processing the second f ile)The patch below modifies the accepted grammar of ecpg to accept FETCH [direction] [amount] cursor namei.e. the IN|FROM clause becomes optional (as in Oracle and Informix).This removes the incompatibility mentioned in section "Porting FromOther RDBMS Packages" p169, PostgreSQL Programmer's Guide. The grammaris modified in such a way as to avoid shift/reduce conflicts. It doesnot accept the statement "EXEC SQL FETCH;" anymore, as the old grammardid (this seems to be a bug of the old grammar anyway).This patch cleans up the handling of space characters in the scanner;some patte rns require \n to be in {space}, some do not. A second fix isthe handling of cpp continuati on lines; the old pattern did not matchthese. The parser is patched to fix an off-by-one error in the #linedirectives. The pa rser is also enhanced to report the correct locationof errors in declarations in the "E XEC SQL DECLARE SECTION". Finally,some right recursions in the parser were replaced by left-recursions.This patch adds preprocessor directives to ecpg; in particularEXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF and EXEC SQL ENDIF"EXEC SQL IFDEF" is used with defines made with "EXEC SQL DEFINE" anddefines, specified on the command line with -D. Defines, specified onthe command line are persistent across multiple input files. Defines canbe nested up to a maximum level of 128 (see patch). There is a fairamount of error checking to make sure directives are matched properly. Ineed preprocessor directives for porting code, that is written for anInformix database, to a PostgreSQL database, while maintainingcompatibility with the original code. I decided not to extend thealready large ecpg grammar. Everything is done in the scanner by addingsome states, e.g. to skip all input except newlines and directives. Thepreprocessor commands are compatible with Informix. Oracle uses a cppreplacement.Rene Hogendoorn1 parenta0fa26b commitb57b0e0
4 files changed
+238
-61
lines changedLines changed: 44 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
21 | 23 |
| |
22 | 24 |
| |
23 |
| - | |
| 25 | + | |
24 | 26 |
| |
25 | 27 |
| |
26 | 28 |
| |
| |||
33 | 35 |
| |
34 | 36 |
| |
35 | 37 |
| |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 |
| |
37 | 51 |
| |
38 | 52 |
| |
| |||
46 | 60 |
| |
47 | 61 |
| |
48 | 62 |
| |
49 |
| - | |
| 63 | + | |
50 | 64 |
| |
51 | 65 |
| |
52 | 66 |
| |
| |||
74 | 88 |
| |
75 | 89 |
| |
76 | 90 |
| |
| 91 | + | |
| 92 | + | |
| 93 | + | |
77 | 94 |
| |
78 | 95 |
| |
79 | 96 |
| |
| |||
97 | 114 |
| |
98 | 115 |
| |
99 | 116 |
| |
100 |
| - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
101 | 120 |
| |
102 | 121 |
| |
103 | 122 |
| |
| |||
170 | 189 |
| |
171 | 190 |
| |
172 | 191 |
| |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
173 | 203 |
| |
174 |
| - | |
175 |
| - | |
| 204 | + | |
176 | 205 |
| |
177 |
| - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
178 | 210 |
| |
179 |
| - | |
180 |
| - | |
181 |
| - | |
| 211 | + | |
| 212 | + | |
182 | 213 |
| |
| 214 | + | |
183 | 215 |
| |
184 | 216 |
| |
185 | 217 |
| |
| |||
193 | 225 |
| |
194 | 226 |
| |
195 | 227 |
| |
| 228 | + | |
196 | 229 |
| |
197 | 230 |
| |
198 | 231 |
| |
199 | 232 |
| |
200 | 233 |
| |
201 |
| - | |
| 234 | + | |
202 | 235 |
| |
203 | 236 |
| |
204 | 237 |
| |
|
0 commit comments
Comments
(0)