mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -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)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#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()
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user