Closed GoogleCodeExporter closed 9 years ago
I resolved this issue by debugging PyODBC. In getdata.cpp, on line 330 -
char tempBuffer[1024];
needs an extra byte -
char tempBuffer[1025];
Original comment by carymrob...@gmail.com
on 1 Aug 2012 at 10:26
First, thanks so much for tracking this down and reporting the fix. Well done!
This is very odd, though. First, the size of the buffer shouldn't matter since
the size is given to the driver. Meaning, we now tell the driver that there is
room for 1025 bytes, so the bug should appear again. What is the size of the
data you are reading?
For safety, I'll add 2 bytes (for a Unicode termintor) and pass 1024 as the
buffer size, but I really would like to know how to reproduce it. (The SQL
Server tests try a bunch of sizes.)
Original comment by mkleehammer
on 17 Aug 2012 at 2:17
Thank you for following up! Problem may be driver specific. I was using
Remedy 6 ARDBC. I was originally querying it using the ODBC C API, so
transitioning to pyodbc has been great. It works fine when using ODBC
directly with C++ so I'm not exactly sure why my fix works but it does.
Size was 1023 I believe. I have provided a lot of info via this SO
question.
http://stackoverflow.com/questions/11657958/pyodbc-cursor-fetchall-causes-python
-to-crash-segfault
Once again, thanks for your help!
Original comment by carymrob...@gmail.com
on 20 Aug 2012 at 1:56
Original issue reported on code.google.com by
carymrob...@gmail.com
on 25 Jul 2012 at 4:25