mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge pilot.mysql.com:/data/msvensson/mysql/my50-bt-36463
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-bugteam
This commit is contained in:
@ -43,6 +43,8 @@ static DYNAMIC_STRING ds_args;
|
|||||||
static char *opt_password= 0;
|
static char *opt_password= 0;
|
||||||
static my_bool tty_password= 0;
|
static my_bool tty_password= 0;
|
||||||
|
|
||||||
|
static char opt_tmpdir[FN_REFLEN];
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
|
static char *default_dbug_option= (char*) "d:t:O,/tmp/mysql_upgrade.trace";
|
||||||
#endif
|
#endif
|
||||||
@ -113,6 +115,8 @@ static struct my_option my_long_options[]=
|
|||||||
#endif
|
#endif
|
||||||
{"socket", 'S', "Socket file to use for connection.",
|
{"socket", 'S', "Socket file to use for connection.",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
{"tmpdir", 't', "Directory for temporary files",
|
||||||
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
|
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
|
||||||
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#include <sslopt-longopts.h>
|
#include <sslopt-longopts.h>
|
||||||
@ -239,6 +243,11 @@ get_one_option(int optid, const struct my_option *opt,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 't':
|
||||||
|
strnmov(opt_tmpdir, argument, sizeof(opt_tmpdir));
|
||||||
|
add_option= FALSE;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'b': /* --basedir */
|
case 'b': /* --basedir */
|
||||||
case 'v': /* --verbose */
|
case 'v': /* --verbose */
|
||||||
case 'd': /* --datadir */
|
case 'd': /* --datadir */
|
||||||
@ -460,7 +469,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
|||||||
char query_file_path[FN_REFLEN];
|
char query_file_path[FN_REFLEN];
|
||||||
DBUG_ENTER("run_query");
|
DBUG_ENTER("run_query");
|
||||||
DBUG_PRINT("enter", ("query: %s", query));
|
DBUG_PRINT("enter", ("query: %s", query));
|
||||||
if ((fd= create_temp_file(query_file_path, NULL,
|
if ((fd= create_temp_file(query_file_path, opt_tmpdir,
|
||||||
"sql", O_CREAT | O_SHARE | O_RDWR,
|
"sql", O_CREAT | O_SHARE | O_RDWR,
|
||||||
MYF(MY_WME))) < 0)
|
MYF(MY_WME))) < 0)
|
||||||
die("Failed to create temporary file for defaults");
|
die("Failed to create temporary file for defaults");
|
||||||
|
@ -1520,7 +1520,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
|
|||||||
DBUG_ENTER("dyn_string_cmp");
|
DBUG_ENTER("dyn_string_cmp");
|
||||||
DBUG_PRINT("enter", ("fname: %s", fname));
|
DBUG_PRINT("enter", ("fname: %s", fname));
|
||||||
|
|
||||||
if ((fd= create_temp_file(temp_file_path, NULL,
|
if ((fd= create_temp_file(temp_file_path, TMPDIR,
|
||||||
"tmp", O_CREAT | O_SHARE | O_RDWR,
|
"tmp", O_CREAT | O_SHARE | O_RDWR,
|
||||||
MYF(MY_WME))) < 0)
|
MYF(MY_WME))) < 0)
|
||||||
die("Failed to create temporary file for ds");
|
die("Failed to create temporary file for ds");
|
||||||
|
@ -493,7 +493,7 @@ static void DbugParse(CODE_STATE *cs, const char *control)
|
|||||||
}
|
}
|
||||||
|
|
||||||
end= DbugStrTok(control);
|
end= DbugStrTok(control);
|
||||||
while (1)
|
while (control < end)
|
||||||
{
|
{
|
||||||
int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0;
|
int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0;
|
||||||
if (sign) control++;
|
if (sign) control++;
|
||||||
|
@ -1431,7 +1431,15 @@ sub datadir_list_setup () {
|
|||||||
|
|
||||||
sub collect_mysqld_features () {
|
sub collect_mysqld_features () {
|
||||||
my $found_variable_list_start= 0;
|
my $found_variable_list_start= 0;
|
||||||
my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
|
my $tmpdir;
|
||||||
|
if ( $opt_tmpdir ) {
|
||||||
|
# Use the requested tmpdir
|
||||||
|
mkpath($opt_tmpdir) if (! -d $opt_tmpdir);
|
||||||
|
$tmpdir= $opt_tmpdir;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Execute "mysqld --help --verbose" to get a list
|
# Execute "mysqld --help --verbose" to get a list
|
||||||
@ -1497,7 +1505,7 @@ sub collect_mysqld_features () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rmtree($tmpdir);
|
rmtree($tmpdir) if (!$opt_tmpdir);
|
||||||
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
|
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
|
||||||
mtr_error("Could not find variabes list") unless $found_variable_list_start;
|
mtr_error("Could not find variabes list") unless $found_variable_list_start;
|
||||||
|
|
||||||
@ -1810,6 +1818,7 @@ sub mysql_upgrade_arguments()
|
|||||||
mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
|
mtr_add_arg($args, "--socket=$master->[0]->{'path_sock'}");
|
||||||
mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
|
mtr_add_arg($args, "--datadir=$master->[0]->{'path_myddir'}");
|
||||||
mtr_add_arg($args, "--basedir=$glob_basedir");
|
mtr_add_arg($args, "--basedir=$glob_basedir");
|
||||||
|
mtr_add_arg($args, "--tmpdir=$opt_tmpdir");
|
||||||
|
|
||||||
if ( $opt_debug )
|
if ( $opt_debug )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user