[unixODBC-dev] segfault

Peter Harvey pharvey at peterharvey.org
Tue Oct 30 08:40:43 GMT 2012


fyi: s/SQLGETDIAGFIELDW/SQLGETDIAGFIELD




           else if ( !__get_connection( head ) -> unicode_driver &&
                CHECK_SQLGETDIAGFIELD( __get_connection( head )))
            {
printf( "[PAH][%s][%d][%s] %p\n", __FILE__, __LINE__, __FUNCTION__,
(__get_connection( head )->functions)[42].funcW  );
                ret = SQLGETDIAGFIELDW( __get_connection( head ),
                        SQL_HANDLE_STMT,
                        __get_driver_handle( head ),



Peter Harvey wrote:
> Hey Nick,
>
> Playing around with an ODBC problem. Possible bug in unixODBC. Built
> sqliteodbc3 driver without wchar support (oversight) and then had my app
> (which is built for UNICODE) call;
>
> SQLPrepare
> SQLExecute (fails as I expect)
>
> Then the following segafults... 
>
> SQLGetDiagField( nType, hHandle, 0, SQL_DIAG_DYNAMIC_FUNCTION, NULL, 0, &nChars );
>
> This seems to be caused by using a null function pointer in the function array - presumably because the driver does not have SQLGetDiagFieldW. I would think that the DM would check for null function pointer.
>
> Let me know if you want me to fix this (ie in the sourceforge repo).
>
> --
> Cheers
> Peter
> BTW: I know that I should expect SQL_ERROR from the SQLGetDiagField call in this case - just not a segfault ;)
>  
>
>  
> _______________________________________________
> unixODBC-dev mailing list
> unixODBC-dev at mailman.unixodbc.org
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
>



More information about the unixODBC-dev mailing list