Uh oh!
There was an error while loading. Please reload this page.
CHORE: e2e bulk copy into a CLR UDT column (GH-667) - #683
Conversation
Adds an end-to-end bulkcopy test using the built-in geometry CLR UDT (same 0xF0 wire path as custom UDTs, which need a deployed assembly). Seeds a geometry column, reads the serialized UDT bytes, bulk copies them into a second geometry column, and asserts a byte-exact round-trip including a NULL. Requires the GH-667 fix in mssql_py_core (microsoft/mssql-rs#111): the varbinary(max) wire mapping plus bytes->UDT value coercion. Lands with the mssql-py-core version bump.
d6b27fb to
f389d0cCompareThere was a problem hiding this comment.
Pull request overview
Adds an end-to-end regression test to validate that cursor.bulkcopy() can insert CLR UDT values (via the built-in geometry type) by round-tripping the UDT’s serialized bytes, covering both non-NULL and NULL rows. This extends the bulkcopy integration suite to exercise the TDS 0xF0 (UDT) wire path via mssql_py_core.
Changes:
- Add
test_bulkcopy_udt_geometryto seedgeometryvalues, fetch their serialized form, bulk copy into a secondgeometrycolumn, and assert byte-exact equality. - Ensure the test explicitly covers a NULL row alongside non-NULL UDT values.
Uh oh!
There was an error while loading. Please reload this page.
Gaurav Sharma (bewithgaurav)
left a comment
There was a problem hiding this comment.
will the tests pass on vbump gargsaumya ? approved
gargsaumya
commented
Jul 24, 2026
yes Gaurav |
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 59.9%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 76.3%
mssql_python.__init__.py: 77.3%
mssql_python.row.py: 77.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 81.4%
mssql_python.pybind.connection.connection.cpp: 83.7%
mssql_python.connection.py: 84.7%🔗 Quick Links
|
Uh oh!
There was an error while loading. Please reload this page.
Adds an end-to-end
bulkcopytest for CLR UDT columns (GH-667).Summary
What
test_bulkcopy_udt_geometryseeds ageometrycolumn, reads the serialized UDT bytes back, bulk copies them into a secondgeometrycolumn, and asserts a byte-exact round-trip (including a NULL row).The built-in
geometryCLR UDT travels the identical TDS0xF0wire path as custom UDTs (which require a deployed assembly, impractical in CI), so it faithfully exercises the fixed path.Why
Before the fix,
cursor.bulkcopy()into any UDT column failed - first with a malformedvarbinary(-1)/Unsupported TDS type for bulk copy: 0xF0, and (once the wire mapping was fixed) with atarget SQL type is Udtvalue-coercion error.Dependency
This test requires the GH-667 fix in
mssql_py_core(microsoft/mssql-rs#111), which contains two parts:mssql-tds: map UDT tovarbinary(max)for the bulk-copy wire type / COLMETADATA / statement text.mssql-py-core: acceptbytes-> UDT in bulk-copy value coercion.Validated locally end-to-end against SQL Server with a py-core built from that branch. This should land together with the
mssql-py-coreversion bump that ships the fix (the maintainers will handle the bump).Related: microsoft/mssql-rs#111 · Fixes#667