maximemaher / pyodbc

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

pyodbc incorrectly ignores Precision/Scale when inserting Decimal values #320

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using Firebird SQL Server, create a table with a column of datatype 
DECIMAL(9,5)
2. The maximum allowed value in a such a column is 21474.83647, or 
(2^31-1)/(10^5). Now, attempt to INSERT a value larger than the maximum into 
the column

What is the expected output? What do you see instead?
I expect the error:
#       SQL Message : -802
#        Arithmetic overflow or division by zero has occurred.
But instead, pyodbc inserts the value -21474.8365

What version of the product are you using? On what operating system?
Python 2.7.3 (32 bit)
pyodbc-3.0.6-py2.7
Firebird SQL Server 1.5.6.5026 (32 bit)
Firebird ODBC Driver 2.0.1.152 (32 bit)
Windows 7 Professional x64

Please provide any additional information below.
Attached is a test script illustrating the problem. (pyodbc also can't seem to 
SELECT the value -21474.8365 properly, but maybe that is a separate issue?)

Original issue reported on code.google.com by jtas...@gmail.com on 30 Apr 2013 at 3:46

Attachments: