Bug #28358 | libmysql.dll cannot be dynamically loaded on Windows | ||
---|---|---|---|
Submitted: | 10 May 2007 16:20 | Modified: | 27 May 2007 16:30 |
Reporter: | TOM DONOVAN (Candidate Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Packaging | Severity: | S2 (Serious) |
Version: | 5.0.41, 5.1 | OS: | Windows |
Assigned to: | Daniel Fischer | CPU Architecture: | Any |
[10 May 2007 16:20]
TOM DONOVAN
[10 May 2007 18:42]
MySQL Verification Team
Thank you for the bug report. "The symbol USE_TLS is no longer defined in the Windows build." How you verified that because looking our download page the source package for Windows is still the version 5.0.37 and looking the project solution from the current source tree I have; /O2 /Ob1 /I "." /I "..\include" /I "../zlib" /I "../extra/yassl/include" /D "DBUG_OFF" /D "NDEBUG" /D "USE_TLS" /D "MYSQL_CLIENT" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0710" /D "_WINDLL" /GF /FD /EHsc /MT /Gy /Fp".\release_obj/libmysql.pch" /Fo".\release_obj/" /Fd".\release_obj/" /W3 /nologo /c /errorReport:prompt Thanks in advance.
[10 May 2007 18:56]
TOM DONOVAN
I built MySQL 5.0.41 from the source at http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.41.tar.gz/from/pick using VC8 SP1, Win Platform SDK 2003 R2, & CMake 2.4. Yes - the symbol was defined 5.0.37 (and 5.0.40), but it is not defined in 5.0.41. More important, the pre-built Windows 32-bit binaries from http://dev.mysql.com/downloads/mysql/5.0.html fail to dynamically load on Win2k & WinXP.
[10 May 2007 19:24]
MySQL Verification Team
Thank you foe the feedback. I created the project solution with: [miguel@light mysql-5.0]$ scripts/make_win_src_distribution. So I assume you used a procedure using CMake?
[10 May 2007 20:06]
TOM DONOVAN
I built using: CSCRIPT .\win\configure.js WITH_INNOBASE_STORAGE_ENGINE EMBED_MANIFESTS (edited the file .\win\configure.data and fixed the unclosed double-quotes) .\win\build-vs8.bat Then I used the MySQL.sln solution file. I made sure the path to cmake.exe and bison.exe was in my "build exe dirs". * Config 'Release' or 'RelWithDebInfo' gives the same results as the pre-built binaries. * If I define USE_TLS and rebuild, libmysql.dll can be dynamically loaded. Here's a short stand-alone test program. Give the .dll filename as an argument. #include <windows.h> main(int argc, char **argv) { HMODULE hndl; hndl = LoadLibraryEx(argv[1],NULL,0); if (!hndl) printf("System Error %d\n", GetLastError()); else printf("Loaded OK, handle = 0x%lx\n", hndl); } C:\MySQL> CL test.c C:\MySQL> test.exe libmsql.dll System Error 998 C:\MySQL> NET HELPMSG 998 Invalid access to memory location.
[11 May 2007 2:29]
Scott MacVicar
I just spent the last few hours trying to work out why I couldn't load the latest PHP connectors I just built. Dropping in an older libmysql.dll resolves the issue. I can confirm the symptoms but haven't got any spare time to look at the cause.
[11 May 2007 12:38]
Jean-Yves Délèze
I had exactly the same problem with libmysql.dll (v5.0.41) from the pre-built Windows 32-bit binary. When I build the dll using VC++ 2005 Express Edition, Windows Platform SDK 2003 R2, CMake 2.4.6 and bison 2.1, the problem is the same. Like Tom, the dll can be dynamically loaded if I define USE_TLS before building.
[11 May 2007 13:02]
Sveta Smirnova
Thank you for the report. Verified as described in last comment: CMake doesn't set USE_TLS
[14 May 2007 11:24]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/26587 ChangeSet@1.2484, 2007-05-14 13:20:18+02:00, df@pippilotta.erinye.com +1 -0 bug#28358 libmysql.dll cannot be dynamically loaded on Windows
[24 May 2007 15:14]
Bugs System
Pushed into 5.1.19-beta
[24 May 2007 19:31]
Bugs System
Pushed into 5.0.44
[25 May 2007 11:42]
Joerg Bruehe
Included in the 5.1.19 build, and in the main tree for next 5.0 (= 5.0.44).
[27 May 2007 16:30]
Paul DuBois
Noted in 5.0.44, 5.1.19 changelogs. libmysql.dll could not be dynamically loaded on Windows.
[5 Jul 2007 12:17]
MySQL Verification Team
Bug: http://bugs.mysql.com/bug.php?id=29566 was marked as duplicate of this one.