Commit 5e72143
Fix C bugs, add audit comments, and deduplicate FK check code
Bug fixes:
- Fix DatumNegativeInfinity passing text* to numeric_in (expects cstring).
Use CStringGetDatum + DirectFunctionCall3 instead of cstring_to_text.
- Fix write_history not validating SPI_fnumber result before SPI_gettypeid,
matching the validation pattern in generated_always_as_row_start_end.
Audit comment:
- Add detailed comment block above FK/UK plan cache declarations documenting
lifecycle, transaction scoping, cleanup callback, and session-scoped plans.
Refactor:
- Extract shared fk_check_c() helper from fk_insert_check_c/fk_update_check_c,
eliminating ~250 lines of near-identical code. The only difference between
insert and update is which tuple to validate (tg_trigtuple vs tg_newtuple).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent fdd7422 commit 5e72143
2 files changed
Lines changed: 71 additions & 277 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
418 | | - | |
419 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
| |||
0 commit comments