Skip to content

test: minimal reproduction for inserting binary buffers into String/FixedString (#837)#861

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/create-minimal-reproduction-test
Draft

test: minimal reproduction for inserting binary buffers into String/FixedString (#837)#861
Copilot wants to merge 2 commits into
mainfrom
copilot/create-minimal-reproduction-test

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal reproduction test for #837: inserting raw binary Buffer data into a String/FixedString column via JSONEachRow. JSONEachRow values are interpreted as UTF-8 text, so any byte >= 0x80 is re-encoded into a multi-byte sequence — overflowing a FixedString (TOO_LARGE_STRING_SIZE) and silently corrupting a String.

Tests live in client-node only; the behavior is not yet exercised for the Web client.

  • FixedString case — asserts insert fails with TOO_LARGE_STRING_SIZE (0xF00xC3 0xB0 overflows FixedString(2)).
  • String case — asserts round-tripped bytes are corrupted (F0F0C3B0C3B0).
  • Both cases added to packages/client-node/__tests__/integration/node_insert_binary_string.test.ts.
const binary = Buffer.from([0xf0, 0xf0]);
await client.insert({
  table, // fs FixedString(2)
  values: [{ fs: binary.toString("binary") }],
  format: "JSONEachRow",
}); // rejects: TOO_LARGE_STRING_SIZE

Checklist

  • Unit and integration tests covering the common scenarios were added

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants