Commit 3dc6f041 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-15693 Stop packaging data directory into ZIPs

Remove CMake INSTALL command for COMPONENT DataFiles.

mysql_install_db.exe will calculate default datadir, so that it can be
called without any parameters.
parent 2e6d8fcc
...@@ -448,12 +448,6 @@ IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING) ...@@ -448,12 +448,6 @@ IF(WIN32 AND TARGET mysqld AND NOT CMAKE_CROSSCOMPILING)
ALL ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
) )
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DESTINATION .
COMPONENT DataFiles
PATTERN "initdb.dep" EXCLUDE
PATTERN "bootstrap.sql" EXCLUDE
PATTERN "aria*" EXCLUDE
)
ELSE() ELSE()
# Not windows or cross compiling, just install an empty directory # Not windows or cross compiling, just install an empty directory
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles) INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
......
...@@ -39,7 +39,8 @@ struct IUnknown; ...@@ -39,7 +39,8 @@ struct IUnknown;
extern "C" const char* mysql_bootstrap_sql[]; extern "C" const char* mysql_bootstrap_sql[];
char default_os_user[]= "NT AUTHORITY\\NetworkService"; static char default_os_user[]= "NT AUTHORITY\\NetworkService";
static char default_datadir[MAX_PATH];
static int create_db_instance(); static int create_db_instance();
static uint opt_silent; static uint opt_silent;
static char datadir_buffer[FN_REFLEN]; static char datadir_buffer[FN_REFLEN];
...@@ -169,8 +170,27 @@ int main(int argc, char **argv) ...@@ -169,8 +170,27 @@ int main(int argc, char **argv)
exit(error); exit(error);
if (!opt_datadir) if (!opt_datadir)
{ {
my_print_help(my_long_options); /*
die("parameter --datadir=# is mandatory"); Figure out default data directory. It "data" directory, next to "bin" directory, where
mysql_install_db.exe resides.
*/
strcpy(default_datadir, self_name);
p = strrchr(default_datadir, FN_LIBCHAR);
if (p)
{
*p= 0;
p= strrchr(default_datadir, FN_LIBCHAR);
if (p)
*p= 0;
}
if (!p)
{
die("--datadir option not provided, and default datadir not found");
my_print_help(my_long_options);
}
strncat(default_datadir, "\\data", sizeof(default_datadir));
opt_datadir= default_datadir;
printf("Default data directory is %s\n",opt_datadir);
} }
/* Print some help on errors */ /* Print some help on errors */
......
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