- Notifications
You must be signed in to change notification settings - Fork28
Commitd160882
committed
Fix bootstrap parser so that its keywords are unreserved words.
Mark Dilger pointed out that the bootstrap parser does not allowany of its keywords to appear as column values unless they're quoted,and proposed dealing with that by quoting such values in genbki.pl.Looking closer, though, we also have that problem with respect to table,column, and type names appearing in the .bki file: the parser would failif any of those matched any of its keywords. While so far there havebeen no conflicts (that I've heard of), this seems like a booby trapwaiting to catch somebody. Rather than clutter genbki.pl with enoughquoting logic to handle all that, let's make the bootstrap parser growup a little bit and treat its keywords as unreserved.Experimentation shows that it's fairly easy to do so with the exceptionof _null_, which I don't have a big problem with keeping as a reservedword. The only change needed is that we can't have the "close" commandtake an optional table name: it has to either require or forbid thetable name to avoid shift/reduce conflicts. genbki.pl has historicallyalways included the table name, so I took that option.The implementation has bootscanner.l passing forward the string valueof each keyword, in case bootparse.y needs that. This avoids needing toknow the precise spelling of each keyword in bootparse.y, which is goodbecause that's not always obvious from the token name.Discussion:https://postgr.es/m/3024FC91-DB6D-4732-B31C-DF772DF039A0@gmail.com1 parent5c4c771 commitd160882
File tree
3 files changed
+79
-52
lines changed- doc/src/sgml
- src/backend/bootstrap
3 files changed
+79
-52
lines changedLines changed: 7 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
248 | 248 |
| |
249 | 249 |
| |
250 | 250 |
| |
| 251 | + | |
| 252 | + | |
251 | 253 |
| |
252 | 254 |
| |
253 | 255 |
| |
| |||
752 | 754 |
| |
753 | 755 |
| |
754 | 756 |
| |
755 |
| - | |
| 757 | + | |
756 | 758 |
| |
757 | 759 |
| |
758 | 760 |
| |
759 | 761 |
| |
760 |
| - | |
761 |
| - | |
| 762 | + | |
| 763 | + | |
762 | 764 |
| |
763 | 765 |
| |
764 | 766 |
| |
| |||
782 | 784 |
| |
783 | 785 |
| |
784 | 786 |
| |
785 |
| - | |
786 |
| - | |
| 787 | + | |
| 788 | + | |
787 | 789 |
| |
788 | 790 |
| |
789 | 791 |
| |
|
Lines changed: 31 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
108 | 109 |
| |
109 | 110 |
| |
110 | 111 |
| |
| |||
116 | 117 |
| |
117 | 118 |
| |
118 | 119 |
| |
119 |
| - | |
120 |
| - | |
121 | 120 |
| |
122 |
| - | |
123 |
| - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
124 | 128 |
| |
125 | 129 |
| |
126 | 130 |
| |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 | 131 |
| |
131 | 132 |
| |
132 | 133 |
| |
| |||
160 | 161 |
| |
161 | 162 |
| |
162 | 163 |
| |
163 |
| - | |
| 164 | + | |
164 | 165 |
| |
165 | 166 |
| |
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 | 170 |
| |
176 | 171 |
| |
177 | 172 |
| |
| |||
489 | 484 |
| |
490 | 485 |
| |
491 | 486 |
| |
492 |
| - | |
493 |
| - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
494 | 509 |
| |
495 | 510 |
| |
496 | 511 |
| |
|
Lines changed: 41 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
71 | 83 |
| |
72 | 84 |
| |
73 |
| - | |
| 85 | + | |
74 | 86 |
| |
75 |
| - | |
| 87 | + | |
76 | 88 |
| |
77 |
| - | |
| 89 | + | |
78 | 90 |
| |
79 |
| - | |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 |
| - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
85 | 98 |
| |
86 |
| - | |
| 99 | + | |
87 | 100 |
| |
88 | 101 |
| |
89 | 102 |
| |
90 | 103 |
| |
91 | 104 |
| |
92 | 105 |
| |
93 | 106 |
| |
94 |
| - | |
95 |
| - | |
96 |
| - | |
97 |
| - | |
98 |
| - | |
99 |
| - | |
100 |
| - | |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
111 | 122 |
| |
112 | 123 |
| |
113 | 124 |
| |
114 | 125 |
| |
115 | 126 |
| |
116 | 127 |
| |
117 |
| - | |
| 128 | + | |
| 129 | + | |
118 | 130 |
| |
119 |
| - | |
| 131 | + | |
120 | 132 |
| |
121 | 133 |
| |
122 | 134 |
| |
123 | 135 |
| |
124 | 136 |
| |
125 | 137 |
| |
126 | 138 |
| |
127 |
| - | |
128 |
| - | |
129 | 139 |
| |
130 | 140 |
| |
131 | 141 |
| |
|
0 commit comments
Comments
(0)