You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using pyodbc version 3.0.7 and 3.0.8-beta06 (latest from github) I get a bus error when trying to parse a decimal value returned from a bogus expression on iSeries (AS400).
For example this simple test segfaults every time:
print cur.execute("SELECT decimal('', 10, 2) FROM SYSIBM.SYSDUMMY1").fetchone()
It seems like SQLGetData() returns a bogus overflowed value in the cbFetched variable:
Program received signal SIGBUS, Bus error.
0x00007ffff560aca7 in GetDataDecimal (iCol=<optimized out>, cur=<optimized out>) at /home/jbq/pyodbc/src/getdata.cpp:486
486 if (buffer[i] == chDecimal)
(gdb) list
481
482 int cch = (int)(cbFetched / sizeof(SQLWCHAR));
483
484 for (int i = (cch - 1); i >= 0; i--)
485 {
486 if (buffer[i] == chDecimal)
487 {
488 // Must force it to use '.' since the Decimal class doesn't pay attention to the locale.
489 buffer[i] = '.';
490 }
(gdb) print cbFetched
$14 = 4294967295
Any help would be appreciated, as I haven't been able to figure out what's wrong. I'd be glad to provide more information if needed. I need this code to be working and willing to sponsor development if this could speedup resolution.
Thanks!
The text was updated successfully, but these errors were encountered:
Using pyodbc version 3.0.7 and 3.0.8-beta06 (latest from github) I get a bus error when trying to parse a decimal value returned from a bogus expression on iSeries (AS400).
For example this simple test segfaults every time:
It seems like SQLGetData() returns a bogus overflowed value in the cbFetched variable:
Any help would be appreciated, as I haven't been able to figure out what's wrong. I'd be glad to provide more information if needed. I need this code to be working and willing to sponsor development if this could speedup resolution.
Thanks!
The text was updated successfully, but these errors were encountered: