Skip to content

Commit ac5a534

Browse files
committed
Merge remote-tracking branch '10.4' into 10.5
2 parents e093e5a + eaebe8b commit ac5a534

File tree

306 files changed

+10915
-6610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+10915
-6610
lines changed

.gitlab-ci.yml

Lines changed: 494 additions & 0 deletions
Large diffs are not rendered by default.

.gitmodules

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
[submodule "libmariadb"]
22
path = libmariadb
33
url = https://github.com/MariaDB/mariadb-connector-c.git
4-
ignore = all
54
[submodule "storage/rocksdb/rocksdb"]
65
path = storage/rocksdb/rocksdb
76
url = https://github.com/facebook/rocksdb.git
8-
ignore = all
97
[submodule "wsrep-lib"]
108
path = wsrep-lib
119
url = https://github.com/codership/wsrep-lib.git
1210
branch = master
13-
ignore = all
1411
[submodule "extra/wolfssl/wolfssl"]
1512
path = extra/wolfssl/wolfssl
1613
url = https://github.com/wolfSSL/wolfssl.git
17-
ignore = all
1814
[submodule "storage/maria/libmarias3"]
1915
path = storage/maria/libmarias3
2016
url = https://github.com/mariadb-corporation/libmarias3.git
21-
ignore = all
2217
[submodule "storage/columnstore/columnstore"]
2318
path = storage/columnstore/columnstore
2419
url = https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
25-
ignore = all

client/mysql.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5369,6 +5369,7 @@ static void init_username()
53695369
full_username=my_strdup(PSI_NOT_INSTRUMENTED, cur[0],MYF(MY_WME));
53705370
part_username=my_strdup(PSI_NOT_INSTRUMENTED, strtok(cur[0],"@"),MYF(MY_WME));
53715371
(void) mysql_fetch_row(result); // Read eof
5372+
mysql_free_result(result);
53725373
}
53735374
}
53745375

client/mysql_plugin.c

Lines changed: 52 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -102,35 +102,35 @@ int main(int argc,char *argv[])
102102
MY_INIT(argv[0]);
103103
sf_leaking_memory=1; /* don't report memory leaks on early exits */
104104
plugin_data.name= 0; /* initialize name */
105-
105+
106106
/*
107107
The following operations comprise the method for enabling or disabling
108108
a plugin. We begin by processing the command options then check the
109109
directories specified for --datadir, --basedir, --plugin-dir, and
110110
--plugin-ini (if specified). If the directories are Ok, we then look
111111
for the mysqld executable and the plugin soname. Finally, we build a
112112
bootstrap command file for use in bootstraping the server.
113-
113+
114114
If any step fails, the method issues an error message and the tool exits.
115-
115+
116116
1) Parse, execute, and verify command options.
117117
2) Check access to directories.
118118
3) Look for mysqld executable.
119119
4) Look for the plugin.
120120
5) Build a bootstrap file with commands to enable or disable plugin.
121-
121+
122122
*/
123123
if ((error= process_options(argc, argv, operation)) ||
124124
(error= check_access()) ||
125125
(error= find_tool("mysqld" FN_EXEEXT, server_path)) ||
126126
(error= find_plugin(tp_path)) ||
127127
(error= build_bootstrap_file(operation, bootstrap)))
128128
goto exit;
129-
129+
130130
/* Dump the bootstrap file if --verbose specified. */
131131
if (opt_verbose && ((error= dump_bootstrap_file(bootstrap))))
132132
goto exit;
133-
133+
134134
/* Start the server in bootstrap mode and execute bootstrap commands */
135135
error= bootstrap_server(server_path, bootstrap);
136136

@@ -238,7 +238,7 @@ static int run_command(char* cmd, const char *mode)
238238
#ifdef __WIN__
239239
/**
240240
Check to see if there are spaces in a path.
241-
241+
242242
@param[in] path The Windows path to examine.
243243
244244
@retval int spaces found = 1, no spaces = 0
@@ -253,7 +253,7 @@ static int has_spaces(const char *path)
253253

254254
/**
255255
Convert a Unix path to a Windows path.
256-
256+
257257
@param[in] path The Windows path to examine.
258258
259259
@returns string containing path with / changed to \\
@@ -335,12 +335,12 @@ static int get_default_values()
335335
#ifdef __WIN__
336336
{
337337
char *format_str= 0;
338-
338+
339339
if (has_spaces(tool_path) || has_spaces(defaults_file))
340340
format_str = "\"%s --mysqld > %s\"";
341341
else
342342
format_str = "%s --mysqld > %s";
343-
343+
344344
snprintf(defaults_cmd, sizeof(defaults_cmd), format_str,
345345
add_quotes(tool_path), add_quotes(defaults_file));
346346
if (opt_verbose)
@@ -675,7 +675,7 @@ static int load_plugin_data(char *plugin_name, char *config_file)
675675
{
676676
reason= "Bad format in plugin configuration file.";
677677
fclose(file_ptr);
678-
goto error;
678+
goto error;
679679
}
680680
break;
681681
}
@@ -709,7 +709,7 @@ static int load_plugin_data(char *plugin_name, char *config_file)
709709
}
710710
}
711711
}
712-
712+
713713
fclose(file_ptr);
714714
return 0;
715715

@@ -740,7 +740,7 @@ static int check_options(int argc, char **argv, char *operation)
740740
int num_found= 0; /* number of options found (shortcut loop) */
741741
char config_file[FN_REFLEN]; /* configuration file name */
742742
char plugin_name[FN_REFLEN]; /* plugin name */
743-
743+
744744
/* Form prefix strings for the options. */
745745
const char *basedir_prefix = "--basedir=";
746746
size_t basedir_len= strlen(basedir_prefix);
@@ -815,7 +815,7 @@ static int check_options(int argc, char **argv, char *operation)
815815
return 1;
816816
}
817817
/* If a plugin was specified, read the config file. */
818-
else if (strlen(plugin_name) > 0)
818+
else if (strlen(plugin_name) > 0)
819819
{
820820
if (load_plugin_data(plugin_name, config_file))
821821
{
@@ -847,22 +847,22 @@ static int check_options(int argc, char **argv, char *operation)
847847

848848
/**
849849
Parse, execute, and verify command options.
850-
850+
851851
This method handles all of the option processing including the optional
852852
features for displaying data (--print-defaults, --help ,etc.) that do not
853853
result in an attempt to ENABLE or DISABLE of a plugin.
854-
854+
855855
@param[in] arc Count of arguments
856856
@param[in] argv Array of arguments
857857
@param[out] operation Operation (ENABLE or DISABLE)
858-
858+
859859
@retval int error = 1, success = 0, exit program = -1
860860
*/
861861

862862
static int process_options(int argc, char *argv[], char *operation)
863863
{
864864
int error= 0;
865-
865+
866866
/* Parse and execute command-line options */
867867
if ((error= handle_options(&argc, &argv, my_long_options, get_one_option)))
868868
return error;
@@ -881,7 +881,7 @@ static int process_options(int argc, char *argv[], char *operation)
881881
char buff[FN_REFLEN];
882882
if (basedir_len + 2 > FN_REFLEN)
883883
return -1;
884-
884+
885885
memcpy(buff, opt_basedir, basedir_len);
886886
buff[basedir_len]= '/';
887887
buff[basedir_len + 1]= '\0';
@@ -890,7 +890,7 @@ static int process_options(int argc, char *argv[], char *operation)
890890
opt_basedir= my_strdup(PSI_NOT_INSTRUMENTED, buff, MYF(MY_FAE));
891891
}
892892
}
893-
893+
894894
/*
895895
If the user did not specify the option to skip loading defaults from a
896896
config file and the required options are not present or there was an error
@@ -925,18 +925,18 @@ static int process_options(int argc, char *argv[], char *operation)
925925

926926
/**
927927
Check access
928-
928+
929929
This method checks to ensure all of the directories (opt_basedir,
930930
opt_plugin_dir, opt_datadir, and opt_plugin_ini) are accessible by
931931
the user.
932-
932+
933933
@retval int error = 1, success = 0
934934
*/
935935

936936
static int check_access()
937937
{
938938
int error= 0;
939-
939+
940940
if ((error= my_access(opt_basedir, F_OK)))
941941
{
942942
fprintf(stderr, "ERROR: Cannot access basedir at '%s'.\n",
@@ -1048,21 +1048,21 @@ static int find_plugin(char *tp_path)
10481048

10491049
/**
10501050
Build the bootstrap file.
1051-
1051+
10521052
Create a new file and populate it with SQL commands to ENABLE or DISABLE
10531053
the plugin via REPLACE and DELETE operations on the mysql.plugin table.
10541054
10551055
param[in] operation The type of operation (ENABLE or DISABLE)
10561056
param[out] bootstrap A FILE* pointer
1057-
1057+
10581058
@retval int error = 1, success = 0
10591059
*/
10601060

10611061
static int build_bootstrap_file(char *operation, char *bootstrap)
10621062
{
10631063
int error= 0;
10641064
FILE *file= 0;
1065-
1065+
10661066
/*
10671067
Perform plugin operation : ENABLE or DISABLE
10681068
@@ -1073,10 +1073,10 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
10731073
<plugin_name>.ini configuration file. Once the file is built, a call to
10741074
mysqld is made in read only, bootstrap modes to read the SQL statements
10751075
and execute them.
1076-
1076+
10771077
Note: Replace was used so that if a user loads a newer version of a
10781078
library with a different library name, the new library name is
1079-
used for symbols that match.
1079+
used for symbols that match.
10801080
*/
10811081
if ((error= make_tempfile(bootstrap, "sql")))
10821082
{
@@ -1123,7 +1123,7 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
11231123
printf("# Disabling %s...\n", plugin_data.name);
11241124
}
11251125
}
1126-
1126+
11271127
exit:
11281128
fclose(file);
11291129
return error;
@@ -1132,11 +1132,11 @@ static int build_bootstrap_file(char *operation, char *bootstrap)
11321132

11331133
/**
11341134
Dump bootstrap file.
1135-
1135+
11361136
Read the contents of the bootstrap file and print it out.
1137-
1137+
11381138
@param[in] bootstrap_file Name of bootstrap file to read
1139-
1139+
11401140
@retval int error = 1, success = 0
11411141
*/
11421142

@@ -1173,7 +1173,7 @@ static int dump_bootstrap_file(char *bootstrap_file)
11731173

11741174
/**
11751175
Bootstrap the server
1176-
1176+
11771177
Create a command line sequence to launch mysqld in bootstrap mode. This
11781178
will allow mysqld to launch a minimal server instance to read and
11791179
execute SQL commands from a file piped in (the bootstrap file). We use
@@ -1194,47 +1194,39 @@ static int dump_bootstrap_file(char *bootstrap_file)
11941194

11951195
static int bootstrap_server(char *server_path, char *bootstrap_file)
11961196
{
1197-
char bootstrap_cmd[FN_REFLEN];
1197+
char bootstrap_cmd[FN_REFLEN]= {0};
1198+
char lc_messages_dir_str[FN_REFLEN]= {0};
11981199
int error= 0;
11991200

12001201
#ifdef __WIN__
12011202
char *format_str= 0;
12021203
const char *verbose_str= NULL;
1203-
1204-
1204+
#endif
1205+
1206+
if (opt_lc_messages_dir != NULL)
1207+
snprintf(lc_messages_dir_str, sizeof(lc_messages_dir_str), "--lc-messages-dir=%s",
1208+
opt_lc_messages_dir);
1209+
1210+
#ifdef __WIN__
12051211
if (opt_verbose)
12061212
verbose_str= "--console";
12071213
else
12081214
verbose_str= "";
1215+
12091216
if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
1210-
has_spaces(bootstrap_file))
1211-
{
1212-
if (opt_lc_messages_dir != NULL)
1213-
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
1214-
else
1215-
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s <%s\"";
1216-
}
1217+
has_spaces(bootstrap_file) || has_spaces(lc_messages_dir_str))
1218+
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s %s <%s\"";
12171219
else
1218-
{
1219-
if (opt_lc_messages_dir != NULL)
1220-
format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s <%s\"";
1221-
else
1222-
format_str= "%s %s --bootstrap --datadir=%s --basedir=%s <%s";
1223-
}
1220+
format_str= "%s %s --bootstrap --datadir=%s --basedir=%s %s <%s";
1221+
12241222
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd), format_str,
12251223
add_quotes(convert_path(server_path)), verbose_str,
12261224
add_quotes(opt_datadir), add_quotes(opt_basedir),
1227-
add_quotes(bootstrap_file));
1225+
add_quotes(lc_messages_dir_str), add_quotes(bootstrap_file));
12281226
#else
1229-
if (opt_lc_messages_dir != NULL)
1230-
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
1231-
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s --lc-messages-dir=%s"
1232-
" <%s", server_path, opt_datadir, opt_basedir, opt_lc_messages_dir, bootstrap_file);
1233-
else
1234-
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
1235-
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s"
1236-
" <%s", server_path, opt_datadir, opt_basedir, bootstrap_file);
1237-
1227+
snprintf(bootstrap_cmd, sizeof(bootstrap_cmd),
1228+
"%s --no-defaults --bootstrap --datadir=%s --basedir=%s %s"
1229+
" <%s", server_path, opt_datadir, opt_basedir, lc_messages_dir_str, bootstrap_file);
12381230
#endif
12391231

12401232
/* Execute the command */
@@ -1247,6 +1239,6 @@ static int bootstrap_server(char *server_path, char *bootstrap_file)
12471239
fprintf(stderr,
12481240
"ERROR: Unexpected result from bootstrap. Error code: %d.\n",
12491241
error);
1250-
1242+
12511243
return error;
12521244
}

0 commit comments

Comments
 (0)