MyODBC SQLBindParameter segfault

MyODBC SQLBindParameter segfault

am 28.03.2005 14:48:37 von Todd Jackson

Hi

I'm writing a program using the MyODBC connector to a database and am
trying to insert into a table with a longblob in it.

When I execute SQLBindParameter,I bind in a character array that
contains the blob and it returns OK. However, when I execute the
statement the program segfaults and terminates.

Is this a limitation of MyODBC? Or is there something I'm doing
incorrectly?

Thanks,

Todd

shareFile = (char*)calloc( shareFileLength, sizeof( char ) );
...
rtn = SQLFreeStmt( hstmt, SQL_DROP );
rtn = SQLAllocHandle( SQL_HANDLE_STMT,
hdbc,
&hstmt);
rtn = SQLPrepare( hstmt, query, SQL_NTS );

if( rtn != SQL_SUCCESS && rtn != SQL_SUCCESS_WITH_INFO )
printf( "Error in query\n" );

printf( "Binding...\n" );
rtn = SQLBindParameter( hstmt, 1, SQL_PARAM_INPUT, SQL_C_BINARY,
SQL_LONGVARBINARY,
0, 0, shareFile,
0,SQL_LEN_DATA_AT_EXEC(shareFileLength));
if( rtn != SQL_SUCCESS && rtn != SQL_SUCCESS_WITH_INFO )
printf( "Error in bind\n" );

printf( "Executing...\n" );
rtn = SQLExecute( hstmt );

--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org