Skip to content

Add a disabled mssql-python ODBC parity test suite - #177

Closed
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
dev/saurabh/odbc-python-parity-tests
Closed

Add a disabled mssql-python ODBC parity test suite#177
Saurabh Singh (saurabh500) wants to merge 1 commit into
mainfrom
dev/saurabh/odbc-python-parity-tests

Conversation

@saurabh500

Copy link
Copy Markdown
Contributor

What this adds

A single-file GoogleTest suite pinning the ODBC behaviour that mssql-python depends on, plus README-parity.md describing how to work through it.

mssql-python does not use a Driver Manager. It calls LoadLibraryW on msodbcsql18.dll and resolves the entrypoints itself, so this driver alone owns the entire ODBC contract -- nothing normalises arguments, sequences calls, or covers for a missing export. The suite loads the driver the same way, which makes it a faithful stand-in for the Python integration suite and much faster to run.

Every case is disabled

All 22 cases carry the gtest DISABLED_ prefix. CI builds and runs the binary, reports them as skipped, and exits 0. No database is needed for the skipped run.

These describe behaviour the driver is expected to have, ahead of it having that behaviour. The intent is that cases are enabled one at a time, each in the pull request that implements the corresponding API work.

Two rules, also stated in the file header and the README:

  • Do not enable a case without the corresponding driver work.
  • Do not re-disable a case to make CI pass. A case that starts failing is a driver regression.

To see where the driver currently stands:

mssql_python_parity_test.exe --gtest_also_run_disabled_tests

Coverage

Transactions, block fetch and row-array binding, concurrent cursors, SQLGetData conversions and NULL/truncation reporting, SQLColAttribute, the five catalog functions, parameter binding, APD descriptor fields, SQLRowCount, and SQLMoreResults.

Includes two cases for the data-at-execution path -- SQLParamData/SQLPutData for streamed parameters, and chunked SQLGetData for LOB reads -- since mssql-python uses both for anything above its inline size threshold and neither was previously covered.

README-parity.md has the full table and a suggested order to work through them, sequenced by which failures mask others.

Notes

  • Windows-only for now: the loader uses LoadLibraryW/GetProcAddress and the fixtures assume a 2-byte wchar_t for SQLWCHAR. CMakeLists.txt guards the target with if(WIN32). Porting to dlopen and an explicit UTF-16 string type is future work.
  • No driver code is touched, so nothing here can change runtime behaviour.

Related Issues

Follow-up to the mssql-python parity investigation in #175.

mssql-python loads this driver with LoadLibraryW and calls the exports
directly, so the driver owns the whole ODBC contract with no Driver
Manager in between. This suite loads it the same way and pins the
behaviour that contract depends on.

All 22 cases are DISABLED. They describe behaviour the driver does not
have yet; each one is enabled in the pull request that implements it.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e698c659-8b42-43f7-99ab-46f534b2489b
# Windows-only for now: the loader uses LoadLibraryW/GetProcAddress and the
# fixtures assume a 2-byte wchar_t for SQLWCHAR. Porting it to dlopen and an
# explicit UTF-16 string type is tracked as future work.
if(WIN32)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This needs to be done for non-windows i.e. Linux/MacOS and Alpine linux as well.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%

🎯 Overall Coverage

91.0%

📦 Project: mssql-tds + mssql-odbc + mssql-py-core
ℹ️ Note: diff coverage is reported, not enforced.


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


🔗 Quick Links

View Azure DevOps Build · Coverage Report

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.

1 participant