• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / wrappers / 21668712743
76%

Build:
DEFAULT BRANCH: main
Ran 04 Feb 2026 11:25AM UTC
Jobs 1
Files 58
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Feb 2026 10:55AM UTC coverage: 76.143% (+0.1%) from 76.042%
21668712743

push

github

web-flow
fix: serialize data instead of pointer in plan_foreign_modify (#548)

* fix: serialize data instead of pointer in plan_foreign_modify

Fix PostgreSQL server crash when using prepared statements with foreign
tables. PostgreSQL caches query plans after ~5-6 executions. The previous
implementation stored a raw pointer to FdwModifyState in fdw_private,
which became invalid after end_foreign_modify freed the state.

Solution:
- Add FdwModifyPrivate struct holding serializable reconstruction data
- Serialize table OID, rowid info (not pointer) in plan_foreign_modify
- Create fresh FdwModifyState in begin_foreign_modify for each execution

Also includes stress test for issue #482 that executes 15 parameterized
INSERT operations to validate the fix.

Fixes #482
Related to #237

* fix: serialize data instead of pointer in plan_foreign_modify

Fixes PostgreSQL server crash when using prepared statements with
foreign tables (issue #482).

The root cause was that PostgreSQL caches query plans after ~5-6
executions (generic plan optimization). The previous implementation
stored a raw pointer to FdwModifyState in fdw_private, which became
invalid after end_foreign_modify freed the state. Subsequent executions
with cached plans dereferenced this stale pointer, causing a crash.

Solution:
- Add FdwModifyPrivate struct holding serializable reconstruction data
- Serialize table OID, rowid info (not pointer) in plan_foreign_modify
- Create fresh FdwModifyState in begin_foreign_modify for each execution

This ensures each query execution gets a valid FDW instance and state,
even when PostgreSQL reuses a cached query plan and skips planning.

* test(clickhouse): add prepared statement stress test

Validates fix for issue #482 by executing 15 parameterized INSERT
operations - enough to trigger PostgreSQL's generic plan caching.
Before the fix, this would crash around iteration 7.

* fix(clippy): inline format args in stress test

Fix uninlined-format-args clippy warning by... (continued)

76 of 80 new or added lines in 1 file covered. (95.0%)

1 existing line in 1 file now uncovered.

6776 of 8899 relevant lines covered (76.14%)

53.0 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
88.31
0.49% supabase-wrappers/src/modify.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
88.31
0.49% supabase-wrappers/src/modify.rs
Jobs
ID Job ID Ran Files Coverage
1 21668712743.1 04 Feb 2026 11:25AM UTC 58
76.14
GitHub Action Run
Source Files on build 21668712743
  • Tree
  • List 58
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #21668712743
  • 8d542a9a on github
  • Prev Build on main (#21655489420)
  • Next Build on main (#21701281252)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc