Hello,
I get a nasty segmentation fault as soon as a SQLconnect fails using
unixodbc,
e.g. the isql coming with! The ddd output is quoted below.
Let me tell you how I build the Drivers etc., maybe the
error is related to this.
I used gcc version 2.95.3 20010315 (SuSE), to compile:
unixODBC-2.2.2.tar.gz from www.unixodbc.com
MyODBC-3.51.03.tar.gz from www.mysql.com
!!!! HOWEVER, when building the driver from MyODBC 3.51.02 which came with
unixodbc,
this seg fault doesn't occur !!!!
The server in binary distribution
mysql-3.23.52-pc-linux-gnu-i686.tar.gz
und the shared lib and devel and stuff
MySQL-shared-3.23.52-1.i386.rpm
MySQL-devel-3.23.52-1.i386.rpm
Here, I am wondering, whether these have been build for thread-safe-clients,
as this has been required somewhere.
I tried to follow the build instruction in INSTALL best I could, for
unixODBC and
especially for MyODBC, I didn't rebuild the mySQL binaries, and the shared
client
libs, though.
So, ddd gives to following output, where ===>>> indicates the SEGFAULT
in error.c
SQLRETURN SQL_API SQLError(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt,
SQLCHAR FAR *szSqlState,
SQLINTEGER FAR *pfNativeError,
SQLCHAR FAR *szErrorMsg,
SQLSMALLINT cbErrorMsgMax,
SQLSMALLINT FAR *pcbErrorMsg)
{
SQLRETURN error=SQL_INVALID_HANDLE;
DBUG_ENTER("SQLError");
if (hstmt){
error = my_SQLGetDiagRec(SQL_HANDLE_STMT,hstmt,1,szSqlState,
pfNativeError, szErrorMsg,
cbErrorMsgMax,pcbErrorMsg);
if(error == SQL_SUCCESS)
CLEAR_STMT_ERROR(((STMT FAR*)hstmt));
}
else if (hdbc){
error = my_SQLGetDiagRec(SQL_HANDLE_DBC,hdbc,1,szSqlState,
pfNativeError, szErrorMsg,
cbErrorMsgMax,pcbErrorMsg);
if(error == SQL_SUCCESS)
CLEAR_STMT_ERROR(((STMT FAR*)hstmt));
}
else if (henv){
error = my_SQLGetDiagRec(SQL_HANDLE_ENV,henv,1,szSqlState,
pfNativeError, szErrorMsg,
cbErrorMsgMax,pcbErrorMsg);
if(error == SQL_SUCCESS)
===>>> CLEAR_STMT_ERROR(((STMT FAR*)hstmt));
}
DBUG_RETURN(error);
}
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 14777)]
0x40cd56e7 in SQLError (henv=0x0, hdbc=0x80bf090, hstmt=0x0,
szSqlState=0xbfffcefc "S1000", pfNativeError=0xbfffc8ec,
szErrorMsg=0xbfffccf8 "[MySQL][ODBC 3.51 Driver]Access denied for user:
'XXXXXXXXX' (Using password: YES)", cbErrorMsgMax=513,
pcbErrorMsg=0xbfffc8f2) at error.c:616
/XXXXXXX/XXXXX/XXXXXXXXXXXXXXXX/mysql/MyODBC-3.51.03/error.c:616:20083:beg
:0x40cd56e7
Current language: auto; currently c
(gdb)
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php