Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 121: update with large parameter + no rows updated = error

Issue and patch (!) from luke@deller.id.au.  Thanks.
  • Loading branch information...
commit 2949f2301a2b720b17391c9f14c2d3eb7536b47e 1 parent d0f9733
Michael Kleehammer authored
Showing with 6 additions and 1 deletion.
  1. +1 −1  src/cursor.cpp
  2. +5 −0 tests/sqlservertests.py
2  src/cursor.cpp
View
@@ -711,7 +711,7 @@ execute(Cursor* cur, PyObject* pSql, PyObject* params, bool skip_first)
ret = SQLParamData(cur->hstmt, (SQLPOINTER*)&pParam);
Py_END_ALLOW_THREADS
- if (ret != SQL_NEED_DATA && !SQL_SUCCEEDED(ret))
+ if (ret != SQL_NEED_DATA && ret != SQL_NO_DATA && !SQL_SUCCEEDED(ret))
return RaiseErrorFromHandle("SQLParamData", cur->cnxn->hdbc, cur->hstmt);
TRACE("SQLParamData() --> %d\n", ret);
5 tests/sqlservertests.py
View
@@ -1196,6 +1196,11 @@ def test_untyped_none(self):
value = self.cursor.execute("select ?", None).fetchone()[0]
self.assertEqual(value, None)
+ def test_large_update_nodata(self):
+ self.cursor.execute('create table t1(a varbinary(max))')
+ hundredkb = buffer('x'*100*1024)
+ self.cursor.execute('update t1 set a=? where 1=0', (hundredkb,))
+
def main():
from optparse import OptionParser
Please sign in to comment.
Something went wrong with that request. Please try again.