Skip to content

Commit

Permalink
Merge branch '10.2' into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Sep 7, 2021
2 parents b85b834 + 0d3de06 commit a6383a1
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 11 deletions.
63 changes: 52 additions & 11 deletions client/mysql_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static uint opt_no_defaults= 0;
static uint opt_print_defaults= 0;
static char *opt_datadir=0, *opt_basedir=0,
*opt_plugin_dir=0, *opt_plugin_ini=0,
*opt_mysqld=0, *opt_my_print_defaults=0;
*opt_mysqld=0, *opt_my_print_defaults=0, *opt_lc_messages_dir;
static char bootstrap[FN_REFLEN];


Expand Down Expand Up @@ -70,6 +70,8 @@ static struct my_option my_long_options[] =
{"my-print-defaults", 'f', "Path to my_print_defaults executable. "
"Example: /source/temp11/extra",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lc-messages-dir", 'l', "The error messages dir for the server. ",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"verbose", 'v',
"More verbose output; you can use this multiple times to get even more "
"verbose output.",
Expand Down Expand Up @@ -305,6 +307,7 @@ static char *add_quotes(const char *path)
--basedir
--plugin-dir
--plugin-ini
--lc-messages-dir
These values are used if the user has not specified a value.
Expand Down Expand Up @@ -382,14 +385,20 @@ static int get_default_values()
{
opt_basedir= my_strdup(value, MYF(MY_FAE));
}
if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir"))))
if ((opt_plugin_dir == 0) && ((value= get_value(line, "--plugin_dir")) ||
(value= get_value(line, "--plugin-dir"))))
{
opt_plugin_dir= my_strdup(value, MYF(MY_FAE));
}
if ((opt_plugin_ini == 0) && ((value= get_value(line, "--plugin_ini"))))
if ((opt_lc_messages_dir == 0) &&
((value= get_value(line, "--lc_messages_dir")) ||
(value= get_value(line, "--lc_messages-dir")) ||
(value= get_value(line, "--lc-messages_dir")) ||
(value= get_value(line, "--lc-messages-dir"))))
{
opt_plugin_ini= my_strdup(value, MYF(MY_FAE));
opt_lc_messages_dir= my_strdup(value, MYF(MY_FAE));
}

}
}
exit:
Expand Down Expand Up @@ -429,6 +438,7 @@ static void usage(void)
--basedir
--plugin-dir
--plugin-ini
--lc-messages-dir
*/

Expand Down Expand Up @@ -461,6 +471,10 @@ static void print_default_values(void)
{
printf("--my_print_defaults=%s ", opt_my_print_defaults);
}
if (opt_lc_messages_dir)
{
printf("--lc_messages_dir=%s ", opt_lc_messages_dir);
}
printf("\n");
}

Expand Down Expand Up @@ -515,6 +529,10 @@ get_one_option(int optid,
case 'f':
opt_my_print_defaults= my_strdup(argument, MYF(MY_FAE));
break;
case 'l':
opt_lc_messages_dir= my_strdup(argument, MYF(MY_FAE));
break;

}
return 0;
}
Expand Down Expand Up @@ -900,6 +918,8 @@ static int process_options(int argc, char *argv[], char *operation)
printf("# plugin_dir = %s\n", opt_plugin_dir);
printf("# datadir = %s\n", opt_datadir);
printf("# plugin_ini = %s\n", opt_plugin_ini);
if (opt_lc_messages_dir != 0)
printf("# lc_messages_dir = %s\n", opt_lc_messages_dir);
}

exit:
Expand Down Expand Up @@ -957,6 +977,12 @@ static int check_access()
opt_my_print_defaults);
goto exit;
}
if (opt_lc_messages_dir && (error= my_access(opt_lc_messages_dir, F_OK)))
{
fprintf(stderr, "ERROR: Cannot access lc-messages-dir path '%s'.\n",
opt_lc_messages_dir);
goto exit;
}

exit:
return error;
Expand Down Expand Up @@ -1186,18 +1212,33 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
verbose_str= "";
if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
has_spaces(bootstrap_file))
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s < %s\"";
else
format_str= "%s %s --bootstrap --datadir=%s --basedir=%s < %s";

{
if (opt_lc_messages_dir != NULL)
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
else
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s <%s\"";
}
else
{
if (opt_lc_messages_dir != NULL)
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
else
format_str= "%s %s --bootstrap --datadir=%s --basedir=%s <%s";
}
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str,
add_quotes(convert_path(server_path)), verbose_str,
add_quotes(opt_datadir), add_quotes(opt_basedir),
add_quotes(bootstrap_file));
#else
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
" < %s", server_path, opt_datadir, opt_basedir, bootstrap_file);
if (opt_lc_messages_dir != NULL)
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s"
" <%s", server_path, opt_datadir, opt_basedir, opt_lc_messages_dir, bootstrap_file);
else
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
" <%s", server_path, opt_datadir, opt_basedir, bootstrap_file);

#endif

/* Execute the command */
Expand Down
16 changes: 16 additions & 0 deletions cmake/build_configurations/mysql_release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ ELSEIF(RPM)
SET(CHECKMODULE /usr/bin/checkmodule CACHE FILEPATH "")
SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE FILEPATH "")
SET(WITH_JEMALLOC "yes" CACHE STRING "")
IF(RPM MATCHES "fedora|centos|rhel")
SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
SET(WITH_INNODB_LZO OFF CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
ENDIF()
IF(RPM MATCHES "opensuse|sles|centos|rhel")
SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
SET(GRN_WITH_LZ4 no CACHE STRING "")
ENDIF()
ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
Expand All @@ -119,6 +129,12 @@ ELSE()
SET(WITH_PCRE bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "")
SET(WITH_JEMALLOC static CACHE STRING "")
SET(WITH_INNODB_BZIP2 OFF CACHE STRING "")
SET(WITH_INNODB_LZ4 OFF CACHE STRING "")
SET(WITH_INNODB_LZO OFF CACHE STRING "")
SET(WITH_ROCKSDB_BZip2 OFF CACHE STRING "")
SET(WITH_ROCKSDB_LZ4 OFF CACHE STRING "")
SET(GRN_WITH_LZ4 no CACHE STRING "")
ENDIF()

IF(NOT COMPILATION_COMMENT)
Expand Down

0 comments on commit a6383a1

Please sign in to comment.