forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit50428a3
committed
Change JsonSemAction to allow non-throw error reporting.
Formerly, semantic action functions for the JSON parser returned void,so that there was no way for them to affect the parser's behavior.That means in particular that they can't force an error exit except bylongjmp'ing. That won't do in the context of our project to make inputfunctions return errors softly. Hence, change them to return the sameJsonParseErrorType enum value as the parser itself uses. If an actionfunction returns anything besides JSON_SUCCESS, the parse is abandonedand that error code is returned.Action functions can thus easily return the same error conditions thatthe parser already knows about. As an escape hatch for expansion, alsoinvent a code JSON_SEM_ACTION_FAILED that the core parser does not knowthe exact meaning of. When returning this code, an action functionmust use some out-of-band mechanism for reporting the error details.This commit simply makes the API change and causes all the existingaction functions to return JSON_SUCCESS, so that there is no actualchange in behavior here. This is long enough and boring enough thatit seemed best to commit it separately from the changes that makereal use of the new mechanism.In passing, remove a duplicate assignment oftransform_string_values_scalar.Discussion:https://postgr.es/m/1436686.1670701118@sss.pgh.pa.us1 parentd02ef65 commit50428a3
File tree
5 files changed
+342
-168
lines changed- src
- backend/utils/adt
- bin/pg_verifybackup
- common
- include/common
5 files changed
+342
-168
lines changedLines changed: 24 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
71 | 71 |
| |
72 |
| - | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| |||
291 | 291 |
| |
292 | 292 |
| |
293 | 293 |
| |
294 |
| - | |
| 294 | + | |
295 | 295 |
| |
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 | 299 |
| |
| 300 | + | |
| 301 | + | |
300 | 302 |
| |
301 | 303 |
| |
302 |
| - | |
| 304 | + | |
303 | 305 |
| |
304 | 306 |
| |
305 | 307 |
| |
306 | 308 |
| |
307 | 309 |
| |
| 310 | + | |
| 311 | + | |
308 | 312 |
| |
309 | 313 |
| |
310 |
| - | |
| 314 | + | |
311 | 315 |
| |
312 | 316 |
| |
313 | 317 |
| |
314 | 318 |
| |
315 | 319 |
| |
| 320 | + | |
| 321 | + | |
316 | 322 |
| |
317 | 323 |
| |
318 |
| - | |
| 324 | + | |
319 | 325 |
| |
320 | 326 |
| |
321 | 327 |
| |
322 | 328 |
| |
323 | 329 |
| |
| 330 | + | |
| 331 | + | |
324 | 332 |
| |
325 | 333 |
| |
326 |
| - | |
| 334 | + | |
327 | 335 |
| |
328 | 336 |
| |
329 | 337 |
| |
| |||
335 | 343 |
| |
336 | 344 |
| |
337 | 345 |
| |
| 346 | + | |
| 347 | + | |
338 | 348 |
| |
339 | 349 |
| |
340 | 350 |
| |
| |||
367 | 377 |
| |
368 | 378 |
| |
369 | 379 |
| |
370 |
| - | |
| 380 | + | |
371 | 381 |
| |
372 | 382 |
| |
373 | 383 |
| |
| |||
443 | 453 |
| |
444 | 454 |
| |
445 | 455 |
| |
| 456 | + | |
| 457 | + | |
446 | 458 |
| |
447 | 459 |
| |
448 | 460 |
| |
|
0 commit comments
Comments
(0)