Skip to content

Retrieving XML data from SQL Server via FreeTDS yields a bus error #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
GoogleCodeExporter opened this issue Mar 18, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use pyodbc to access a SQL Server database which has a table <tbl> which 
contains a column <col> which has the xml datatype.
2. c.execute("select top 1 <col> from <tbl> where <col> is not null")
3. c.fetchall()

What is the expected output? What do you see instead?

I expect to see the contents of the field. Instead, I get a bus error.

What version of the product are you using? On what operating system?

pyodbc 2.1.8
MacOS X 10.6.4
Python 2.6

Please provide any additional information below.

FreeTDS CVS checkout from 11/16/2010
iODBC driver manager
SQL Server 2008 RTM

gdb tells me that the bus error is 

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
0x0038fabf in GetDataString (cur=0x7028e0, iCol=<value temporarily unavailable, 
due to optimizations>) at pyodbc-2.1.8/src/getdata.cpp:194
194         if (PyString_CheckExact(bufferOwner))

I suspect that this is related to issue 97. My value for sys.maxunicode:

65535

For what it's worth, the minimum datalength in the table I'm accessing is 1826.

Original issue reported on code.google.com by s...@mitre.org on 17 Nov 2010 at 8:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant