From: Jonathan M. <io...@ac...> - 2007-08-24 21:13:25
|
On Aug 24, 2007, at 2:11 PM, Michael Hecht wrote: > My app is trying to read data from a DSN that uses the Actual > drivers, talking to MySQL. When issuing a query something like this: > > select count( some_variable ) from some_table; > > We get back a column type of SQL_BIGINT. We try to read the value > via SQLGetData, using SQL_C_SBIGINT data type into a long long. The > result we get back looks like this: 0x20000000000000EF. The correct > answer is 239, which would be correct if that annoying high bit > were off. > > Comparing to Excel, a trace reveals that they use SQLFetch, with a > mapping via SQL_C_DOUBLE. And they get the right answer! > > Should we switch to using a double with SQLGetData, are we doing > something else wrong, or is there some driver/manager bug here? Using the latest Actual ODBC driver for Open Source Databases (MySQL), I get the correct answer when I set up a test case like you describe: SQLLEN dataBufferLen = 0; long long value = 0; rc = SQLGetData(stmt, 1, SQL_C_SBIGINT, &value, sizeof(value), &dataBufferLen); Running this code puts 0xef in value if select count(*) yields a count of 239 rows. I tried this using the iODBC frameworks and /usr/ lib/libiodbc.a, and the results are the same - so I don't think this is a manager issue. Michael, please send me an e-mail and we can take the next steps to troubleshooting this issue. Jonathan Monroe Actual Technologies - ODBC for Mac OS X mo...@ac... |