Skip to content

Commit db18317

Browse files
gargsaumyaCopilot
andcommitted
FIX: align DAE metadata with wide bindings
Use the Unicode-safe MAX boundary for VARCHAR data-at-execution metadata and compare the wide fetch regression by row values rather than generated Row identity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5919670 commit db18317

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎mssql_python/pybind/param_detect.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ inline SQLULEN DAEColumnSize(SQLSMALLINT sqlType, SQLULEN actualSize) {
144144
switch (sqlType) {
145145
case SQL_CHAR:
146146
case SQL_VARCHAR:
147-
return actualSize > MAX_INLINE_BINARY ? 0 : actualSize;
147+
return actualSize > MAX_INLINE_CHAR ? 0 : actualSize;
148148
case SQL_WCHAR:
149149
case SQL_WVARCHAR:
150150
return actualSize > MAX_INLINE_CHAR ? 0 : actualSize;

‎tests/test_004_cursor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ def test_fetchmany_rejects_excessive_native_buffer(cursor):
17481748

17491749
def test_fetchall_clamps_wide_result_batch_to_native_buffer_budget(cursor):
17501750
cursor.execute("SELECT " + ", ".join("CAST(N'x' AS NVARCHAR(4000))" for _ in range(34)))
1751-
assert cursor.fetchall() == [("x",) * 34]
1751+
assert [tuple(row) for row in cursor.fetchall()] == [("x",) * 34]
17521752

17531753

17541754
def test_description(cursor):

0 commit comments

Comments
 (0)