On Sun, Mar 11, 2007 at 07:30:04PM +0000, Enrico Zini wrote: > convert.c has it like this: > > case SQL_C_SLONG: > case SQL_C_LONG: > len = 4; > if (bind_size > 0) > *((SDWORD *) rgbValueBindRow) = atol(neut_str); > else > *((SDWORD *) rgbValue + bind_row) = atol(neut_str); > break; > > but here on amd64 sizeof(long int) == 8.
This seems to have been discussed on the unixodbc-dev lists earlier, look at the thread starting with: http://mail.easysoft.com/pipermail/unixodbc-dev/2005-March/000396.html In particular, there's a message saying that this is indeed expected behavior (ie. that the driver was wrong in 2005): http://mail.easysoft.com/pipermail/unixodbc-dev/2005-March/000397.html The discussion was sent on to the pgsql-odbc mailing list: http://archives.postgresql.org/pgsql-odbc/2005-03/msg00007.php The patch from that thread seems to have fixed it _to_ the current behavior (and it's present, although quite a bit modified, in the version in sid). IOW, I believe there's consensus that SQL_C_LONG should map to _int_, as it currently does, and Enrico's test case is wrong. I found one bug (even after applying the patch that was discussed in the bug log) by peering through the warnings (thank goodness for -Wno-sign-compare -Wno-pointer-sign), though: FORMATI64 (convert.c:192) should be "%ld" and not "%lld" on 64-bits archs (it's within an #ifdef ODBCINT64), and likewise for FORMATI64U on the line below. It's really only the compiler warning, though (that long != long long), as they are both 64 bits in practice. Hardly anything one would want to change during a freeze. :-) /* Steinar */ -- Homepage: http://www.sesse.net/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]