Commit ae6eb7a0 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-11088 Client plugins cannot be loaded by command line tools

in default installation.

Added plugin-dir to the [client] section of the generated my.ini,
so that  installed services (MSI or mysql_install_db.exe) would be able to
find plugin directory.
parent e4978d26
...@@ -387,6 +387,7 @@ IF(WIN32) ...@@ -387,6 +387,7 @@ IF(WIN32)
${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c ${CMAKE_CURRENT_BINARY_DIR}/mysql_bootstrap_sql.c
COMPONENT Server COMPONENT Server
) )
SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
TARGET_LINK_LIBRARIES(mysql_install_db mysys) TARGET_LINK_LIBRARIES(mysql_install_db mysys)
ADD_LIBRARY(winservice STATIC winservice.c) ADD_LIBRARY(winservice STATIC winservice.c)
......
...@@ -233,6 +233,20 @@ static void get_basedir(char *basedir, int size, const char *mysqld_path) ...@@ -233,6 +233,20 @@ static void get_basedir(char *basedir, int size, const char *mysqld_path)
} }
} }
#define STR(s) _STR(s)
#define _STR(s) #s
static char *get_plugindir()
{
static char plugin_dir[2*MAX_PATH];
get_basedir(plugin_dir, sizeof(plugin_dir), mysqld_path);
strcat(plugin_dir, "/" STR(INSTALL_PLUGINDIR));
if (access(plugin_dir, 0) == 0)
return plugin_dir;
return NULL;
}
/** /**
Allocate and initialize command line for mysqld --bootstrap. Allocate and initialize command line for mysqld --bootstrap.
...@@ -313,6 +327,10 @@ static int create_myini() ...@@ -313,6 +327,10 @@ static int create_myini()
fprintf(myini,"protocol=pipe\n"); fprintf(myini,"protocol=pipe\n");
else if (opt_port) else if (opt_port)
fprintf(myini,"port=%d\n",opt_port); fprintf(myini,"port=%d\n",opt_port);
char *plugin_dir = get_plugindir();
if (plugin_dir)
fprintf(myini, "plugin-dir=%s\n", plugin_dir);
fclose(myini); fclose(myini);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment