rajeshveerepalli / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

update with large parameter + no rows updated = error #121

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Apply first attached patch to pyodbc source code to add a test case
2. C:\Python26\python tests\sqlservertests.py "DRIVER={SQL Server Native Client 
10.0};SERVER=localhost;DATABASE=mydatabase;TRUSTED_CONNECTION=yes}"

What is the expected output?
All test cases passed.

What do you see instead?
python:  2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]
pyodbc:  2.1.8 
C:\cygwin\home\myusername\build\pyodbc\build\lib.win32-2.6\pyodbc.pyd
odbc:    03.80.0000
driver:  sqlncli10.dll 10.50.1600
         supports ODBC version 03.52
os:      Windows
unicode: Py_Unicode=2 SQLWCHAR=2
        post2008Server 6.1.7600 Multiprocessor Free
======================================================================
ERROR: test_large_update_nodata (__main__.SqlServerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/sqlservertests.py", line 305, in test_large_update_nodata
    self.cursor.execute('update t1 set a=? where 1=0', (hundredkb,))
Error: ('HY000', 'The driver did not supply an error!')

----------------------------------------------------------------------
Ran 162 tests in 1.316s

FAILED (errors=1)

What version of the product are you using? On what operating system?
pyodbc 2.1.8 (or today's git trunk) with Python 2.6/32-bit on Windows 7, 
Microsoft SQL Server 2008 R2

Please provide any additional information below.
Attached is a patch which fixes this problem for me.

Original issue reported on code.google.com by lukedell...@gmail.com on 20 Sep 2010 at 6:23

Attachments:

GoogleCodeExporter commented 8 years ago
Oops the fix_large_update_nodata.patch has the actual fix commented out so that 
I could reproduce the test failure for this report!

Attaching the corrected patch now.

Original comment by lukedell...@gmail.com on 20 Sep 2010 at 6:29

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the unit tests and the patch!  That's always nice.

Applied in 2.1.9-beta04

Original comment by mkleehammer on 21 Nov 2010 at 5:40