From: Engineering <eng...@as...> - 2009-04-09 15:25:10
|
Hello, I was not sure where to report bugs/fixes, so I hope this is the right location. This is the issue that we encountered: On a x64 Windows 2003 machine, using the ODBC driver we attempted to do a selection from a table containing a DateTime column. MFC CRecordSet uses the data lenth to determine if a field is NULL or not for a date-time, and whenever we had the column as NULL, Firebird ODBC seemed to return the 32-bit value 0xFFFFFFFF (which as a 64-bit value is just a very large number), making our selection invalid (MFC actually complains, because the date/time interpreting is not correct). From what we could tell, the sequence of events is as follows: - MFC Recordset calls ::SQLBindCol with the length parameter as a "LONG_PTR *" (which is a __int64 **) - MFC will call ::SQLExtendedFetch, which fills up the length value, however as a 32-bit number (i.e. will be always positive) I have attached a proposed patch - basically replacing SQLINTEGER with SQLLEN for any index pointers (not sure if this is this the correct term - this is the first time I am messing with this driver). For 32bit this seems to make no difference as the typedefs are the same, however for 64-bit this will change a 32bit value to 64-bit (and would probably need testing). I did test the patch in our environment for date-time columns, however I would appreciate someone more knowledgeable about how the ODBC driver works to take a look. If this can make it into RC2 and/or official release, it would be great. Regards, Andrei Litvin |