forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite5e2fc8
committed
Modernise pg_hba.conf token processing
The previous coding was ugly, as it marked special tokens as such in thewrong stage, relying on workarounds to figure out if they had beenquoted in the original or not. This made it impossible to have specifickeywords be recognized as such only in certain positions in HBA lines,for example. Fix by restructuring the parser code so that it rememberswhether tokens were quoted or not. This eliminates widespread knowledgeof possible known keywords for all fields.Also improve memory management in this area, to use memory contexts thatare reset as a whole instead of using retail pfrees; this removes awhole lotta crufty (and probably slow) code.Instead of calling strlen() three times in next_field_expand on thereturned token to find out whether there was a comma (and strip it),pass back the info directly from the callee, which is simpler.In passing, update historical artifacts in hba.c API.Authors: Brendan Jurd, Alvaro HerreraReviewed by Pavel Stehule1 parent615c384 commite5e2fc8
3 files changed
+656
-620
lines changedLines changed: 4 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 |
| - | |
319 |
| - | |
320 |
| - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
321 | 321 |
| |
322 |
| - | |
323 |
| - | |
324 |
| - | |
325 |
| - | |
326 |
| - | |
| 322 | + | |
327 | 323 |
| |
328 | 324 |
| |
329 | 325 |
| |
|
0 commit comments
Comments
(0)