| Issue 91: | Problem with 38-precision Decimals on SQL Server | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I've found what appears to be a bug in pyodbc when using Decimals of the
maximum precision of 38. Though obviously it's possible I'm just missing
something. I'm using pyodbc 2.1.7 on Windows 7 x64 with an x64 version of
Python 2.6.4. Talking to a MS SQL Server 2008 database.
Simply put, if you try to insert a 38 precision decimal you get this error:
Error: ('HY104', '[HY104] [Microsoft][ODBC SQL Server Driver]Invalid
precision value (0) (SQLBindParameter)')
Using a 37 precision decimal (or less) avoids the problem. I've attached a
simple unit test script which hopefully demonstrates the problem.
Both tests should pass, instead only one is passing. The passing test
inserts a 37 digit decimal, and the failing test inserts a 38 digit one.
SQL Server supports a maximum precision of 38.
Hopefully this is enough info to reproduce the problem.
Aug 24, 2010
Thanks for the patch. I'll add the unit tests as you suggest (always a good idea) and apply the patch to 2.1.8, due very soon.
Status:
Started
Sep 4, 2010
Fixed in the v2unicode branch, which will become 2.1.8 as soon as I'm sure it is ready. Thanks again.
Sep 6, 2010
Fixed in 2.1.8
Status:
Fixed
Nov 21, 2010
(No comment was entered for this change.)
Status:
Complete
|
563 bytes View Download
2.6 KB View Download