My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 269 attachment: pyodbc-bind-param-varchar-max.diff (711 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/src/params.cpp b/src/params.cpp
index f7ef29f..9762cf6 100644
--- a/src/params.cpp
+++ b/src/params.cpp
@@ -157,7 +157,7 @@ static bool GetBytesInfo(Cursor* cur, Py_ssize_t index, PyObject* param, ParamIn

#else
info.ValueType = SQL_C_CHAR;
- info.ColumnSize = (SQLUINTEGER)max(len, 1);
+ info.ColumnSize = 0;

if (len <= cur->cnxn->varchar_maxlength)
{
@@ -183,7 +183,7 @@ static bool GetUnicodeInfo(Cursor* cur, Py_ssize_t index, PyObject* param, Param
Py_ssize_t len = PyUnicode_GET_SIZE(param);

info.ValueType = SQL_C_WCHAR;
- info.ColumnSize = (SQLUINTEGER)max(len, 1);
+ info.ColumnSize = 0;

if (len <= cur->cnxn->wvarchar_maxlength)
{
Powered by Google Project Hosting