Loopback59 / pyodbc

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

sybase iq 15.4 integer -1 and 0 return wrong value #360

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.a table has a column ,that type is int
2.insert tow value 0 and -1 into the table
3.query the tow row use pyodbc 3.0.7

What is the expected output? What do you see instead?
expected 0 and -1 output,but it return -4294967296 and 4294967295 instead

What version of the product are you using? On what operating system?
 pyodbc3.0.7 & Linux version 2.6.32-279.el6.x86_64 

Please provide any additional information below.

Original issue reported on code.google.com by lileix...@gmail.com on 7 Mar 2014 at 2:01

GoogleCodeExporter commented 9 years ago
The same problem exists running on RHEL6 against a Sybase IQ database, Sybase 
ASE database, and a SQL Server database, using Data Direct 7.1 ODBC drivers.  
This problem does not manifest in pyodbc-3.0.3.

conn = pyodbc.connect("DSN=...")
cur = conn.execute("select 1 as num")
print cur.fetchall()
print cur.description

[(206158430209, )]
(('num', <type 'int'>, None, 5, 5, 0, False),)

Same code running on RHEL5:

[(1, )]
(('num', <type 'int'>, None, 5, 5, 0, False),)

The ODBC trace files show that, other than the handles (pointers) used, the 
ODBC processing is identical.

Original comment by colorado...@gmail.com on 7 Aug 2014 at 4:49