[unixODBC-dev] SQLExecDirect with SQL_ERROR dumps core on suselinux-x8664

Nick Gorham nick.gorham at easysoft.com
Wed Jun 24 14:16:00 BST 2009


G, Hemanth Kumar wrote:
>
> Hi Nick,
>
>       I have compiled unixODBC for suselinux-x8664.
> My odbc application dumps core when an incorrect sql statement is used 
> in SQLExecDirect.
>
> SQLExecDirect(hstmt, (SQLCHAR *)"select abcd", SQL_NTS);
>

It looks like its trying to call SQLError in the driver, and I guess it 
failed to extract a entry point for SQLError so the attempt to call 
address 0.

The code tests to see if the driver exports SQLGetDiagField or 
SQLGetDiagRec, and if it doesn't assumes that it must be ok to call 
SQLError. IN this case, it seems as if none of the error functions are 
exported by the driver.

I will look at adding a check to prevent the seg fault, but I would 
check whats being exported and what SQLGetFunction is reporting.

-- 
Nick


More information about the unixODBC-dev mailing list