methew / pyodbc

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

selecting NULL from a NUMERIC column produces MemoryError #351

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
test case and ODBC log is attached.  

Client Platform: OSX Maverick
Database: SQL Server 2008
FreeTDS version: 0.82  (can't run 0.91 on OSX due to #247 and other observed 
quirks that I haven't filed bug reports for)
PyODBC version: 3.0.7-beta10

import pyodbc

conn = pyodbc.connect(dsn="ms_2005", user="scott", password="tiger")

cursor = conn.cursor()

cursor.execute("""
CREATE TABLE t (
    x NUMERIC(8, 4) NULL
)
""")

cursor.execute("""
    INSERT INTO t (x) VALUES (?)
""", None)

cursor.execute("""
    SELECT x FROM t
""")
cursor.fetchall()

output:

classic$ python test.py
Traceback (most recent call last):
  File "test.py", line 20, in <module>
    cursor.fetchall()
MemoryError

Original issue reported on code.google.com by zzz...@gmail.com on 28 Dec 2013 at 9:56

Attachments:

GoogleCodeExporter commented 9 years ago
here's the freetds log also.

Original comment by zzz...@gmail.com on 28 Dec 2013 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
same error using FreeTDS 0.91

Original comment by zzz...@gmail.com on 28 Dec 2013 at 10:29

GoogleCodeExporter commented 9 years ago
I'm seeing the same thing as well.
FreeTDS 0.91, unixodbc 2.3.2, pyodbc 3.0.7 and python 2.7.1 

Original comment by d...@inlet.geol.sc.edu on 6 Jun 2014 at 5:10

GoogleCodeExporter commented 9 years ago
Forgot to add, OS = OS X 10.7.5

Original comment by d...@inlet.geol.sc.edu on 6 Jun 2014 at 5:11