Repository navigation
Conversation
…sions The binary array decoder for int4[]/float4[] rejected any column whose value contained a NULL (ERR_POSTGRES_NULLS_IN_ARRAY_NOT_SUPPORTED_YET) or had more than one dimension (ERR_POSTGRES_MULTIDIMENSIONAL_ARRAY_NOT_SUPPORTED_YET). Bun requests the binary result format for these types, so any parameterized query (the extended protocol) hit this path and the whole query failed when a row's array happened to contain a NULL, while the simple/text protocol returned the data correctly. A TypedArray cannot hold null holes or nested arrays, so those cases now decode into a plain JS array: NULL elements (wire length prefix -1) become null, and extra dimensions become nested arrays. Plain 1-D, NULL-free arrays keep the fast Int32Array/Float32Array path.
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
|
Updated 1:05 AM PT - Jul 7th, 2026
❌ @robobun, your commit e870ea1 has some failures in 🧪 To try this PR locally: bunx bun-pr 33577That installs a local version of the PR into your bun-33577 --bun |
|
The diff is green. Both CI runs so far have failed only on the which is Buildkite artifact-download infra on that agent, not a test failure (the job never ran any tests). 257 jobs passed on build 69551, including every lane that ran Ready for review; the darwin-26-aarch64 jobs can be retried individually from the Buildkite UI if needed. |
|
Closing as part of a cleanup of stale pull requests. This PR has had no new commits since 2026-07-07, it conflicts with main, and its last CI run failed. This is not a judgment on the fix itself. If the problem still reproduces on a current build, reopen this PR after a rebase or open a new one against main. |
What
A
Bun.SQL(postgres) query over the extended protocol fails outright when anint4[]/float4[]column value contains aNULLor has more than one dimension:The simple/text protocol returns the same data fine (
[1, null, 3],[[1,2],[3,4]]). Users don't choose the protocol: any parameterized query (tagged templates,sql.unsafe(q, params)) uses the extended protocol, soselect ids from t where owner = ${x}works until one row's array picks up aNULL, then the whole query throws.Cause
Bun requests the binary result format for
int4[]/float4[](Tag::is_binary_format_supporteddrives the Bind result-format codes), then the binary decoderfrom_bytes_typed_arrayinsrc/sql_jsc/postgres/DataCell.rsearly-returned an error oncontains_nulls != 0anddimensions > 1. So Bun rejected a reply its own Bind request produced. postgres.js and node-postgres return[1, null, 3]on both paths.Fix
A
TypedArraycan hold neither null holes nor nested arrays, so those two cases now decode into a plain JS array instead of throwing:-1) becomenull.Plain 1-D, NULL-free arrays keep the fast
Int32Array/Float32Arraypath, so the common case is unchanged. The new binary decoder validates the server-controlled dimension count and per-element lengths against the buffer before reading, matching the bounds checks already in the typed-array path.Verification
New hermetic tests in
test/js/sql/postgres-binary-array-bounds.test.tsdrive a mock wire server that sends binary-format array columns:int4[]/float4[]with a NULL decode to[1, null, 3]/[1.5, null, 3.5]int4[]decodes to[[1,2],[3,4]]int4[]with a NULL decodes to[[1,null],[3,4]]int4[]still returnsInt32Array([1,2,3])The four new tests fail on the released binary with the two
ERR_POSTGRES_*errors and pass with this change; the out-of-bounds rejection tests still pass.