Skip to content

msnodesqlv8 v6: support drivers that hold back a paused query's events #1940

Open

Description

@dhensby

Background

On 2026-10-17, msnodesqlv8 merged groundwork for its next major version (TimelordUK/node-sqlserver-v8#482, #484, #485, #486). It is not released yet. Upstream master's package.json still says 5.6.0, and its engines asks for Node 22 or later. These are the changes that matter to us:

  • A paused query emits nothing until it is resumed. That includes meta, done and free, and what a native call already in flight brings back.
  • resume() only runs the step that is waiting. It no longer fetches while SQLExecDirect or SQLMoreResults is still running.
  • Cancelling a paused query ends it with HY008, then free. The statement is no longer freed while a native call is in flight.
  • A paused query holds its connection. New work on that connection is refused with HY010.

node-mssql declares no msnodesqlv8 version range, so users can install v6 as soon as it is published.

What we found

We built upstream master (aa57e17) from source and ran it on Windows CI against SQL Server 2022, with 5.6.0 alongside for comparison.

msnodesqlv8 on its own:

5.6.0 master
Paused query cancelled after a flushed row count (the crash #1938 works around) segfault in 6 of 6 runs no crash in 6 runs
Paused query resumed while it executes (#1924, which #1928 fixes) extra HY010 on every failing query fixed

node-mssql's msnodesqlv8 suite and scenarios on master:

Adapter Result
node-mssql master Full suite passes (158). Every cancel and resume scenario is correct.
#1938 Cancelling a stream held before its first result set hangs. The deferred cancel waits for meta, done or free, and v6 never emits them while the query is paused.
#1938 with #1928 on top Also hangs on any stream resumed while it is held, because the resume waits for meta. 4 tests time out, including streaming resume.

So both workarounds are right for 5.6.0 and earlier, where the bugs are. Under v6 they must be switched off.

Decision

Wait for the upstream release before choosing how to tell the two apart. Until then a version check can't, because master is still versioned 5.6.0. Master can be told apart by internals, such as DriverMgr.prototype.pausedQuery and Query.prototype.cancelPaused.

Tasks

Related: #1924, #1928, #1938, TimelordUK/node-sqlserver-v8#478, #479, #480, #481.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions