YongpingZhang / pyodbc

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

core dump, pyodbc + Fedora + UnixODBC 2.3.0 + FreeTDS 0.91, odbc + freetds logs attached #212

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
pyodbc 2.1.11
Fedora Release 14
UnixODBC 2.3.0 built from source
FreeTDS 0.91 built from source

Passing a Python unicode as a bind crashes.  This is in conflict with one of my 
users who insists that we pass Python unicode as binds.

    import pyodbc

    conn = pyodbc.connect("dsn=ms_2005;UID=scott;PWD=tiger")

    cursor = conn.cursor()

    cursor.execute("SELECT cast(? AS NVARCHAR)", ('abcdef'))
    print cursor.fetchall()

    cursor.execute("SELECT cast(? AS NVARCHAR)", (u'abcdef'))
    print cursor.fetchall()

ODBC log + FreeTDS log is attached.  Full output is attached, starts with:

[classic@f1 sqlalchemy]$ python test.py
[(u'abcdef', )]
*** glibc detected *** python: free(): invalid next size (fast): 0x08508720 ***

Original issue reported on code.google.com by zzz...@gmail.com on 18 Sep 2011 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
correction, those files are against pyodbc 2.1.9 but just checked I get a core 
dump with 2.1.11 as well.

Original comment by zzz...@gmail.com on 18 Sep 2011 at 6:06

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 3 Nov 2011 at 1:58

GoogleCodeExporter commented 9 years ago
Fixed in 3.0.x versions.  Added unit tests to 3.0.2-beta04

Original comment by mkleehammer on 18 Dec 2011 at 10:26