Skip to content

Commit 9a55bbe

Browse files
committed
copilot review suggestion
1 parent 1af9faa commit 9a55bbe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mssql_python/pybind/ddbc_bindings.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ std::string DescribeChar(unsigned char ch) {
210210
// Given a list of parameters and their ParamInfo, calls SQLBindParameter on each of them with
211211
// appropriate arguments
212212
SQLRETURN BindParameters(SQLHANDLE hStmt, const py::list& params,
213-
const std::vector<ParamInfo>& paramInfos,
213+
std::vector<ParamInfo>& paramInfos,
214214
std::vector<std::shared_ptr<void>>& paramBuffers) {
215215
LOG("Starting parameter binding. Number of parameters: {}", params.size());
216216
for (int paramIndex = 0; paramIndex < params.size(); paramIndex++) {
@@ -325,7 +325,7 @@ SQLRETURN BindParameters(SQLHANDLE hStmt, const py::list& params,
325325
&nullable
326326
);
327327
if (!SQL_SUCCEEDED(rc)) {
328-
LOG("SQLDescribeParam failed for parameter {}", paramIndex);
328+
LOG("SQLDescribeParam failed for parameter {} with error code {}", paramIndex, rc);
329329
return rc;
330330
}
331331
sqlType = describedType;
@@ -336,9 +336,9 @@ SQLRETURN BindParameters(SQLHANDLE hStmt, const py::list& params,
336336
strLenOrIndPtr = AllocateParamBuffer<SQLLEN>(paramBuffers);
337337
*strLenOrIndPtr = SQL_NULL_DATA;
338338
bufferLength = 0;
339-
const_cast<ParamInfo&>(paramInfo).paramSQLType = sqlType;
340-
const_cast<ParamInfo&>(paramInfo).columnSize = columnSize;
341-
const_cast<ParamInfo&>(paramInfo).decimalDigits = decimalDigits;
339+
paramInfo.paramSQLType = sqlType;
340+
paramInfo.columnSize = columnSize;
341+
paramInfo.decimalDigits = decimalDigits;
342342
break;
343343
}
344344
case SQL_C_STINYINT:

0 commit comments

Comments
 (0)