Skip to content

Commit

Permalink
handle bytes in attrs_before
Browse files Browse the repository at this point in the history
It looks like the code to handle byte values in the attrs_before parameter was lost in the v5 upgrade.  Adding it back in.
  • Loading branch information
keitherskine authored and mkleehammer committed Oct 13, 2023
1 parent 7f91191 commit 19beb9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ static bool ApplyPreconnAttrs(HDBC hdbc, SQLINTEGER ikey, PyObject *value, char
ivalue = (SQLPOINTER)PyByteArray_AsString(value);
vallen = SQL_IS_POINTER;
}
else if (PyBytes_Check(value))
{
ivalue = PyBytes_AsString(value);
vallen = SQL_IS_POINTER;
}
else if (PyUnicode_Check(value))
{
sqlchar.set(value, strencoding ? strencoding : "utf-16le");
Expand Down

0 comments on commit 19beb9a

Please sign in to comment.