Repository navigation
fix: warnings the driver attaches to a fetch or execute are no longer dropped - #494
Merged
Merged
Conversation
… worked
msodbcsql hands a warning raised at the end of a result set (8153 null value
eliminated, 3607 division by zero, 3606 arithmetic overflow) to the SQLFetch
that returns SQL_NO_DATA, and for a prepared execution to SQLExecute
(SQL_SUCCESS_WITH_INFO). Neither was read, and a fetch or bind that worked
had no way to pass diagnostics to JS, so these were dropped every time.
- native: keep_diagnostics() appends the records of a call that did not fail;
called on SQL_NO_DATA / SQL_SUCCESS_WITH_INFO from SQLFetch, SQLFetchScroll,
SQLMoreResults and bind_fetch's SQLExecute. TryReadRows starts clean.
- FetchRowsWorker and BindQueryWorker call back (info, result), as
NextResultWorker does.
- bind_fetch resets the result set's end flags after an execute: with info,
the last execution's flags made the next one look finished, losing its rows.
- reader.js keeps a batch's info with the batch and emits it after its rows,
in the server's order; a pause holds it.
1756 (FK on a temp table), thought lost, is a compile-time warning: a cached
plan raises none. Scenarios can put {unique} in their text for this.
Adds the info/ corpus group and scripts/prepared-info, with native recordings.
warnings.test.js expected no info for a null-eliminating query; it now
expects the 8153. cancel/after-error-mid-batch gets an --- or alternative for
the known cancel-cb / HY008 race (also on master).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st v6 test/contract/mssql/tap.js, loaded into node-mssql's mocha run with --require, records every call node-mssql makes on msnodesqlv8 and the events it saw, per test, in the corpus's transcript format. Their suite passes against this branch on node-mssql master, 12.7.10 and 12.7.7 (SNAC 11), bar two SQL-login tests LocalDB can't run. The handover notes node-mssql's own 'done' after a paused cancel, now a second 'done' under v6. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PRs since 5.6.0 were merged with merge commits, so 'What's changed' listed 'Merge pull request #N from ...' under Other. Take the PR title from the merge commit's body, and skip 'Merge branch' commits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Linux an error at execute ends the batch, so the print and result set after it are lost - the same #483 as the other Linux pins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
TimelordUK
added a commit
that referenced
this pull request
Oct 22, 2026
…arnings Warnings SQL Server raises at the end of a result set (8153, 3606, 3607) are delivered as info from 6.0.0 (#494). The driver hands them over on the fetch that finds no more rows (SQL_NO_DATA), and the unixODBC driver manager before 2.3.12 discards them there. Verified with a plain C ODBC probe on Ubuntu 22.04: same msodbcsql18 18.7.1.1 and the same server, no record under the system 2.3.9, the 8153 under 2.3.12. With 2.3.12 the contract suite passes in full on WSL, as it does on CI (ubuntu-24.04). The template now carries a standing known-issue section, with how to check the loaded version and how to install 2.3.12 into /usr/local on 22.04. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
Warnings SQL Server raises at the end of a result set were dropped every time:
8153 "Null value is eliminated by an aggregate", 3607 "Division by zero occurred",
3606 "Arithmetic overflow occurred". msodbcsql attaches them to the
SQLFetchthatreturns
SQL_NO_DATA(and, for a prepared execution, toSQLExecute), and neitherwas read. A fetch or bind that succeeded had no way to pass diagnostics to JS.
keep_diagnostics()reads the records of a call that did not fail, onSQL_NO_DATA/SQL_SUCCESS_WITH_INFOfromSQLFetch,SQLFetchScroll,SQLMoreResults, andSQLExecuteinbind_fetch.TryReadRowsstarts clean.FetchRowsWorkerandBindQueryWorkercall back(info, result), asNextResultWorkerdoes.bind_fetchresets the result set's end flags after each execute: with info, theprevious execution's flags made the next one look finished and its rows were lost.
reader.jsemits a batch's info after its rows, in the server's order; a pause holds it.1756 (FK on a temp table), thought lost, is a compile-time warning: a cached plan
raises none. PRINT / RAISERROR were always delivered.
Tests
info/(45 transcripts) andscripts/prepared-info, with nativerecordings. Expected order checked against .NET SqlClient (TDS, no ODBC).
warnings.test.jsexpected no info for a null-eliminating query; it now expects the 8153.cancel/after-error-mid-batchgets an--- orfor the known cancel-cb / HY008 race (also on master).12.7.10 155, 12.7.7 154; the 2 failures are SQL-login tests LocalDB can't run.
test/contract/mssql/tap.jsrecords how their suite drives us.release-notes.jsreads PR titles from merge commits.🤖 Generated with Claude Code