forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita76cfba
committed
Add safeguards in LSN, numeric and float calculation for custom errors
Those data types use parsing and/or calculation wrapper routines whichcan generate some generic error messages in the event of a failure. Thecaller of these routines can also pass a pointer variable settable bythe routine to track if an error has happened, letting the caller decidewhat to do in the event of an error and what error message to generate.Those routines have been slacking the initialization of the trackingflag, which can be confusing when reading the code, so add somesafeguards against calls of these parsing routines which could lead to adubious result.The LSN parsing gains an assertion to make sure that the tracking flagis set, while numeric and float paths initialize the flag to a sanerstate.Author: Jeevan LadheReviewed-by: Álvaro Herrera, Michael PaquierDiscussion:https://postgr.es/m/CAOgcT0NOM9oR0Hag_3VpyW0uF3iCU=BDUFSPfk9JrWXRcWQHqw@mail.gmail.com1 parent05ba837 commita76cfba
3 files changed
+28
-7
lines changedLines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
340 |
| - | |
| 340 | + | |
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
| |||
376 | 376 |
| |
377 | 377 |
| |
378 | 378 |
| |
| 379 | + | |
| 380 | + | |
| 381 | + | |
379 | 382 |
| |
380 | 383 |
| |
381 | 384 |
| |
| |||
388 | 391 |
| |
389 | 392 |
| |
390 | 393 |
| |
391 |
| - | |
| 394 | + | |
| 395 | + | |
392 | 396 |
| |
393 | 397 |
| |
394 | 398 |
| |
| |||
463 | 467 |
| |
464 | 468 |
| |
465 | 469 |
| |
466 |
| - | |
467 |
| - | |
468 |
| - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
469 | 473 |
| |
470 | 474 |
| |
471 | 475 |
| |
472 | 476 |
| |
473 | 477 |
| |
474 | 478 |
| |
475 | 479 |
| |
476 |
| - | |
| 480 | + | |
| 481 | + | |
477 | 482 |
| |
478 | 483 |
| |
479 | 484 |
| |
| |||
500 | 505 |
| |
501 | 506 |
| |
502 | 507 |
| |
503 |
| - | |
| 508 | + | |
| 509 | + | |
504 | 510 |
| |
505 | 511 |
| |
506 | 512 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2605 | 2605 |
| |
2606 | 2606 |
| |
2607 | 2607 |
| |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
2608 | 2611 |
| |
2609 | 2612 |
| |
2610 | 2613 |
| |
| |||
2721 | 2724 |
| |
2722 | 2725 |
| |
2723 | 2726 |
| |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
2724 | 2730 |
| |
2725 | 2731 |
| |
2726 | 2732 |
| |
| |||
3207 | 3213 |
| |
3208 | 3214 |
| |
3209 | 3215 |
| |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
3210 | 3219 |
| |
3211 | 3220 |
| |
3212 | 3221 |
| |
| |||
6249 | 6258 |
| |
6250 | 6259 |
| |
6251 | 6260 |
| |
| 6261 | + | |
| 6262 | + | |
| 6263 | + | |
6252 | 6264 |
| |
6253 | 6265 |
| |
6254 | 6266 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 |
| |
38 | 41 |
| |
39 | 42 |
| |
|
0 commit comments
Comments
(0)