[unixODBC-support] core dump in libodbccr.so on HP iA64

Nick Gorham nick.gorham at easysoft.com
Wed Nov 14 11:02:58 GMT 2007


Cherie Soleil wrote:

>Thank you very much Nick. I found my problem for setting the
>SQL_CUR_USE_IF_NEEDED.
>
>But when I used your unixodbc2.2.13pre I can still get the exactly
>same core dump as I wrote in previous mails.
>  
>
When I looked at this yesterday, I reduced the operation you were doing 
down to the following

> #include <stdio.h>
> #include <sql.h>
> #include <sqlext.h>
>
> int main( void )
> {
>     SQLHANDLE henv, hdbc, hstmt;
>     SQLRETURN ret;
>     SQLCHAR str[ 256 ], name[ 30 ];
>     SQLINTEGER ival;
>     SQLSMALLINT sival, dtype, ddigits, nul;
>     SQLULEN csize, lval;
>     int long_val;
>
>     ret = SQLAllocHandle( SQL_HANDLE_ENV, NULL, &henv );
>     ret = SQLSetEnvAttr( henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)3, 
> SQL_IS_UINTEGER );
>     ret = SQLAllocHandle( SQL_HANDLE_DBC, henv, &hdbc );
>
>     ret = SQLSetConnectAttr( hdbc, SQL_ATTR_ODBC_CURSORS, 
> SQL_CUR_USE_IF_NEEDED, SQL_IS_UINTEGER );
>     ret = SQLSetConnectAttr( hdbc, SQL_ATTR_QUIET_MODE, SQL_FALSE, 
> SQL_IS_POINTER );
>
>     ret = SQLConnect( hdbc, "driver", SQL_NTS, "user", SQL_NTS, 
> "password", SQL_NTS );
>
>     ret = SQLAllocHandle( SQL_HANDLE_STMT, hdbc, &hstmt );
>
>     ret = SQLExecDirect( hstmt, "select * from ty1", SQL_NTS );
>
>     ret = SQLBindCol( hstmt, 1, SQL_C_SLONG, &long_val, sizeof( 
> long_val ), &lval );
>
>     ret = SQLFetch( hstmt );
>
>     printf( "fetched %d %d %d\n", ret, long_val, lval );
> }


I would expect the above code to show the same problem with the IBM driver.

-- 
Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org




More information about the unixODBC-support mailing list