We have had a problem with MyODBC for a while. We are using MyODBC with
Apache webserver.
From version 20 of MyODBC and forward the webserver have been restarting by
itself, over and over again, but version 19 and earlier worked fine.
I downloaded MyODBC source distribution of version 24, and traced it and
then I found a nasty "__asm int 3;" in this function:
"
static void my_win_init(void)
{
HKEY hSoftMysql ;
DWORD dimName = 256 ;
DWORD dimData = 1024 ;
DWORD dimNameValueBuffer = 256 ;
DWORD dimDataValueBuffer = 1024 ;
DWORD indexValue = 0 ;
long retCodeEnumValue ;
char NameValueBuffer[256] ;
char DataValueBuffer[1024] ;
char EnvString[1271] ;
const char *targetKey = "Software\\MySQL" ;
DBUG_ENTER("my_win_init");
//HERE*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
__asm int 3;
//*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
setlocale(LC_CTYPE, ""); /* To get right sortorder */
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,(LPCTSTR)targetKey,0,
KEY_READ,&hSoftMysql) != ERROR_SUCCESS)
DBUG_VOID_RETURN;
/*
** Ne legge i valori e li inserisce nell'ambiente
** suppone che tutti i valori letti siano di tipo stringa + '\0'
** Legge il valore con indice 0 e lo scarta
*/
retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
(LPTSTR)NameValueBuffer, &dimNameValueBuffer,
NULL, NULL, (LPBYTE)DataValueBuffer,
&dimDataValueBuffer) ;
while (retCodeEnumValue != ERROR_NO_MORE_ITEMS)
{
/* Crea la stringa d'ambiente */
setEnvString(EnvString, NameValueBuffer, DataValueBuffer) ;
/* Inserisce i dati come variabili d'ambiente */
putenv(EnvString) ;
dimNameValueBuffer = dimName ;
dimDataValueBuffer = dimData ;
retCodeEnumValue = RegEnumValue(hSoftMysql, indexValue++,
NameValueBuffer, &dimNameValueBuffer,
NULL, NULL, (LPBYTE)DataValueBuffer,
&dimDataValueBuffer) ;
}
/* chiude la chiave */
RegCloseKey(hSoftMysql) ;
DBUG_VOID_RETURN ;
}
"
The "__asm int 3" is normally used for debugging purposes to make the
program halt.
When i commented it out it worked fine.
There is though an other problem which I havent solved yet. When I compile
the 24
version in my Visual Studio 6.0 Release, I can't open the ODBC source from
VB.
It works fine if I compile it with Debug mode.
I hope someone is helped by my information and I hope that the "_asm int 3;"
bug will
be removed in the next release.
If anyone knows anything about my second problem, please send me a mail.
Nils Frostberg
(c) Media Communications Eur AB (publ)
Stockholm Sweden
Tel: +46(0)8-208585