• Vladislav Vaintroub's avatar
    MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes · 93efbc39
    Vladislav Vaintroub authored
    Stop linking plugins to the server executable on Windows.
    Instead, extract whole server functionality into a large DLL, called
    server.dll. Link both plugins, and small server "stub" exe to it.
    
    This eliminates plugin dependency on the name of the server executable.
    It also reduces the size of the packages (since tiny mysqld.exe
    and mariadbd.exe are now both linked to one big DLL)
    
    Also, simplify the functionality of exporing all symbols from selected
    static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old
    self-backed solution.
    
    fix compile error
    
    replace GetProcAddress(GetModuleHandle(NULL), "variable_name")
    for server exported data with actual variable names.
    
    Runtime loading was never required,was error prone
    , since symbols could be missing at runtime, and now it actually failed,
    because we do not export symbols from executable anymore, but from a shared
    library
    
    This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin,
    but made the code more straightforward, and avoids missing symbols at
    runtime (as mentioned before).
    
    The audit plugin is still doing some dynamic loading, as it aims to work
    cross-version. Now it won't work cross-version on Windows, as it already
    uses some symbols that are *not* dynamically loaded, e.g fn_format
    and those symbols now exported from server.dll , when earlier they were
    exported by mysqld.exe
    
    Windows, fixes for storage engine plugin loading
    after various rebranding stuff
    
    Create server.dll containing functionality of the whole server
    make mariadbd.exe/mysqld.exe a stub that is only  calling mysqld_main()
    
    fix build
    93efbc39
spd_table.cc 344 KB