> import pyodbc
>
> dsn = \
> 'uid=myid;Database=mydb;Driver={SQL Native Client};'\
> 'Server=myserver;pwd=mypwd;'
>
> conn = pyodbc.connect(dsn)
>
> try:
>
> crs = conn.cursor()
> crs.execute("SELECT [fake_field], ?", "abc")
>
> finally:
> conn.close()
Not sure if anyone is reading this... but just to add as much info as
I have... I added some "printf" statements in the code to see where it
was segfaulting (that is about the extent of my debugging skills in C/C
++), and it looks like it is on line 28 in params.cpp:
SQLFreeStmt(cur->hstmt, SQL_RESET_PARAMS);
This happens during the garbage collection it looks like. So the
calling sequence is:
Cursor_dealloc -> closeimpl -> FreeParameterData -> SQLFreeStmt
And I don't think the "conn.close()" call in my example is actually
necessary to demonstrate the segfault. If anyone knowledgeable in C/C+
+ is reading this and has any ideas, would appreciate the info.
Otherwise, have a good day!
- Matt