sqlite: throw on oversized string values - #66209
Merged
nodejs-github-bot merged 1 commit intoSep 29, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66209 +/- ##
==========================================
- Coverage 90.35% 90.35% -0.01%
==========================================
Files 792 792
Lines 275434 275439 +5
Branches 52780 52790 +10
==========================================
- Hits 248878 248861 -17
- Misses 16981 16987 +6
- Partials 9575 9591 +16
🚀 New features to boost your workflow:
|
trivikr
approved these changes
Sep 26, 2026
Member
|
@araujogui The code change looks good. Can you please rebase? |
araujogui
force-pushed
the
sqlite-throw-on-oversized-strings
branch
from
September 28, 2026 13:40
1a27d49 to
efad0d8
Compare
Member
|
The lint errors need fixing /home/runner/work/node/node/test/parallel/test-sqlite-statement.js
Error: 1454:20 error 'DatabaseSync' is not defined no-undef
Error: 1462:20 error 'DatabaseSync' is not defined no-undef |
SQLite serves TEXT up to SQLITE_MAX_LENGTH, past what V8 can represent as a string. V8 returns an empty handle without throwing, and the user-defined function path then suppressed the SQLite error as if a JavaScript exception were pending. exec() reported success for a statement that never ran, and get() returned undefined. Throw ERR_STRING_TOO_LONG when the value cannot be converted, and suppress a SQLite error only when an exception is actually pending. Assisted-by: Claude Code Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
araujogui
force-pushed
the
sqlite-throw-on-oversized-strings
branch
from
September 28, 2026 15:46
efad0d8 to
61fffa5
Compare
trivikr
approved these changes
Sep 28, 2026
Collaborator
Collaborator
|
Landed in c5b7a06 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SQLite serves TEXT up to
SQLITE_MAX_LENGTH(1e9 by default), past whatV8 can represent as a string.
String::NewFromUtf8()returns an emptyhandle without throwing, and the user-defined function path then called
SetIgnoreNextSQLiteError(true)as if a JavaScript exception werepending, so the SQLite error was discarded too.
Utf8StringMaybeOneByte()now throwsERR_STRING_TOO_LONGwhen thevalue exceeds
String::kMaxLength, which covers both the UDF argumentsand the column reads that share it. The suppression in
THROW_ERR_SQLITE_ERROR()is gated on an actually pending exception soit can no longer turn a failed statement into a success.