Skip to content

sqlite: use 64-bit result APIs for UDF return values - #67089

Open
araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-result-blob64
Open

araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-result-blob64

Conversation

@araujogui

Copy link
Copy Markdown
Member

Use sqlite3_result_blob64() and sqlite3_result_text64() so buffers returned from user-defined functions that exceed INT_MAX bytes throw SQLITE_TOOBIG instead of being silently truncated or turned into empty text.

JSValueToSQLiteResult() passed the size_t length of returned
ArrayBuffers and ArrayBufferViews to sqlite3_result_blob(), which
takes an int. Buffers larger than INT_MAX bytes were narrowed,
yielding silently truncated blobs or bogus empty text values.

Use sqlite3_result_blob64() and sqlite3_result_text64(), matching
Statement::BindValue(), so oversized values are rejected with
SQLITE_TOOBIG.

Assisted-by: Claude Code
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 28, 2026 18:27
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (c9b3082) to head (67c70b4).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #67089    +/-   ##
========================================
  Coverage   90.65%   90.65%            
========================================
  Files         797      797            
  Lines      278321   278798   +477     
  Branches    53530    53625    +95     
========================================
+ Hits       252315   252750   +435     
- Misses      16387    16404    +17     
- Partials     9619     9644    +25     
Files with missing lines Coverage Δ
src/node_sqlite.cc 82.24% <100.00%> (+0.03%) ⬆️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants