Commit 210d634
committed
fix(pgwire): infer parameter types from SQL text on prepare
Server-inferred parameter types previously came only from DataFusion
plan analysis, which leaves positions like `LIMIT $1`/`OFFSET $1` and
explicit casts (`$1::BIGINT`) undescribed when the client sends no
declared oid. tokio-postgres then refuses to bind because the
parameter's wire type is unknown.
Add nodedb-sql::infer_placeholder_types to resolve a placeholder's
type directly from the surrounding SQL, and use it to fill any
parameter slot the client left undeclared, independent of whether the
plan-analysis pass succeeds.1 parent 752c4f0 commit 210d634
6 files changed
Lines changed: 764 additions & 12 deletions
File tree
- nodedb-sql/src
- nodedb
- src/control/server/pgwire/handler/prepared
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
0 commit comments