WL#3653: Loadable Engine on WindowsAffects: Server-5.1 — Status: Complete — Priority: LowRATIONALE To make it possible to dynamically load engines (and other plugins) on Windows. (Currently the code is built in the wrong way.) SUMMARY Currently it is not possible to build a dynamically loadable engine as a separate component (.DLL) on Windows. This task is to track the effort of making it work on Windows. Note added by Trudy Pelzer, 2006-12-22: Remarks from WL#3364, cancelled as a duplicate task: "As part of WL#3201, storage engines have been made "plugable", except on Windows. This Worklog is to make plugable storage engine work on Windows." REFERENCES WL#3859 Plug-in Service API Storage engines have code dependencies within the MySQL server that need to be ==How plugin-specific configure parameters are passed to Cmake== Just have checked import library stuff. Turns out that if a symbol marked __declspec(dllexport) is present, the linker will create the import library mysqld.lib anyway.Seems like CMake support is not absolutely necessary. There exists a fork of the 6.0 tree which implements this feature but the only major issues is that CMake does not seem designed to handle executables generating import libraries (so a workaround must has been devised) and the issue of the C runtimes as commented by Vladislav. Working POC for this worklog have existed as far back as December 2006 so the issues/pitfalls are not unknown. I'm afraid this WL is an attempt to solve a non-existing problem. Of course it is possible on Windows to link a DLL against EXE exports using the documented /implib[Name import library] flag (http://msdn2.microsoft.com/en-us/library/67wc07b9(VS.80).aspx) Assume, all functions/data to be exported in the EXE is marked __declspec(dllexport), then you can create import library during the link via link .... /implib:mysqldexe.lib /out:mysqld.exe and then link the DLL with this import library via link [objects etc] mysqldexe.lib /out:mydll.dll Concerning C runtime - I hope you can avoid linking agains MSVCRT.lib and continue provide statically linked libs ,because since VS2005 dynamically linked C runtime is a mess, when it comes to deployment. It is OK to link different modules with static c runtime provided a) you do not exchange certain C runtime data like FILE or file descriptors between different modules. b) corresponding malloc/free, new/delete, putenv/getenv is always called by the same module. Currently at least a) is violated by int mysql_tmpfile(const char </strong>prefix); maybe it would be better just to return unique temp filename here? Or, just remove the function from the plugin api (does it really belong here)? I wrote a little workaround for this Problem and released it on codeproject. However it seems that it may also fit here. If you're interested: http://www.codeguru.com/cpp/misc/misc/plug-insadd-ins/article.php/c14477/ However it's more of a hack than a complete solution, but hey, it works. At least for me... :) |
VotesWatches5 members are watching this worklog
You must be logged in to track this worklog.
Provide Feedback
You must be logged in to comment
|
Hm. Why do not I see what other people are saying...