Skip to content

Commit 7ad0947

Browse files
committed
OPTIMIZATION #3 (FIX): Remove unused columnSize variables (Windows build fix)
Windows compiler treats warnings as errors (/WX flag). The columnSize variable was extracted from columnSizes array but never used in the SQL_CHAR and SQL_WCHAR cases after OPTIMIZATION #3. Changes: -------- - Removed unused 'SQLULEN columnSize' declaration from SQL_CHAR/VARCHAR/LONGVARCHAR case - Removed unused 'SQLULEN columnSize' declaration from SQL_WCHAR/WVARCHAR/WLONGVARCHAR case - Retained fetchBufferSize and isLob which are actually used This fixes Windows build errors: - error C2220: warning treated as error - warning C4189: 'columnSize': local variable is initialized but not referenced The optimization remains intact - metadata is still prefetched from cache-friendly arrays.
1 parent ef095fd commit 7ad0947

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

mssql_python/pybind/ddbc_bindings.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,7 +3280,6 @@ SQLRETURN FetchBatchData(SQLHSTMT hStmt, ColumnBuffers& buffers, py::list& colum
32803280
case SQL_CHAR:
32813281
case SQL_VARCHAR:
32823282
case SQL_LONGVARCHAR: {
3283-
SQLULEN columnSize = columnSizes[col - 1];
32843283
uint64_t fetchBufferSize = fetchBufferSizes[col - 1];
32853284
uint64_t numCharsInData = dataLen / sizeof(SQLCHAR);
32863285
bool isLob = isLobs[col - 1];
@@ -3298,7 +3297,6 @@ SQLRETURN FetchBatchData(SQLHSTMT hStmt, ColumnBuffers& buffers, py::list& colum
32983297
case SQL_WVARCHAR:
32993298
case SQL_WLONGVARCHAR: {
33003299
// TODO: variable length data needs special handling, this logic wont suffice
3301-
SQLULEN columnSize = columnSizes[col - 1];
33023300
uint64_t fetchBufferSize = fetchBufferSizes[col - 1];
33033301
uint64_t numCharsInData = dataLen / sizeof(SQLWCHAR);
33043302
bool isLob = isLobs[col - 1];

0 commit comments

Comments
 (0)