Commit 9af7561e authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-13608 : set client plugin directory with mysql_options()

if plugin_dir is specified. Also, allow to specify protocol (e.g pipe)
parent 06106c01
...@@ -112,6 +112,11 @@ xb_mysql_connect() ...@@ -112,6 +112,11 @@ xb_mysql_connect()
(char *) &opt_secure_auth); (char *) &opt_secure_auth);
} }
if (xb_plugin_dir && *xb_plugin_dir){
mysql_options(connection, MYSQL_PLUGIN_DIR, xb_plugin_dir);
}
mysql_options(connection, MYSQL_OPT_PROTOCOL, &opt_protocol);
msg_ts("Connecting to MySQL server host: %s, user: %s, password: %s, " msg_ts("Connecting to MySQL server host: %s, user: %s, password: %s, "
"port: %s, socket: %s\n", opt_host ? opt_host : "localhost", "port: %s, socket: %s\n", opt_host ? opt_host : "localhost",
opt_user ? opt_user : "not set", opt_user ? opt_user : "not set",
......
...@@ -123,6 +123,7 @@ my_bool xtrabackup_apply_log_only = FALSE; ...@@ -123,6 +123,7 @@ my_bool xtrabackup_apply_log_only = FALSE;
longlong xtrabackup_use_memory = 100*1024*1024L; longlong xtrabackup_use_memory = 100*1024*1024L;
my_bool xtrabackup_create_ib_logfile = FALSE; my_bool xtrabackup_create_ib_logfile = FALSE;
uint opt_protocol;
long xtrabackup_throttle = 0; /* 0:unlimited */ long xtrabackup_throttle = 0; /* 0:unlimited */
lint io_ticket; lint io_ticket;
os_event_t wait_throttle = NULL; os_event_t wait_throttle = NULL;
...@@ -560,6 +561,7 @@ enum options_xtrabackup ...@@ -560,6 +561,7 @@ enum options_xtrabackup
OPT_XTRA_TABLES_EXCLUDE, OPT_XTRA_TABLES_EXCLUDE,
OPT_XTRA_DATABASES_EXCLUDE, OPT_XTRA_DATABASES_EXCLUDE,
OPT_PROTOCOL
}; };
struct my_option xb_client_options[] = struct my_option xb_client_options[] =
...@@ -799,6 +801,9 @@ struct my_option xb_client_options[] = ...@@ -799,6 +801,9 @@ struct my_option xb_client_options[] =
0, 0, 0, GET_STR, 0, 0, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "This option specifies the socket to use when " {"socket", 'S', "This option specifies the socket to use when "
"connecting to the local database server with a UNIX domain socket. " "connecting to the local database server with a UNIX domain socket. "
"The option accepts a string argument. See mysql --help for details.", "The option accepts a string argument. See mysql --help for details.",
...@@ -1364,8 +1369,13 @@ xb_get_one_option(int optid, ...@@ -1364,8 +1369,13 @@ xb_get_one_option(int optid,
start[1]=0 ; start[1]=0 ;
} }
break; break;
case OPT_PROTOCOL:
if (argument)
{
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
opt->name);
}
break;
#include "sslopt-case.h" #include "sslopt-case.h"
case '?': case '?':
......
...@@ -55,6 +55,8 @@ extern char *xtrabackup_incremental_dir; ...@@ -55,6 +55,8 @@ extern char *xtrabackup_incremental_dir;
extern char *xtrabackup_incremental_basedir; extern char *xtrabackup_incremental_basedir;
extern char *innobase_data_home_dir; extern char *innobase_data_home_dir;
extern char *innobase_buffer_pool_filename; extern char *innobase_buffer_pool_filename;
extern char *xb_plugin_dir;
extern uint opt_protocol;
extern ds_ctxt_t *ds_meta; extern ds_ctxt_t *ds_meta;
extern ds_ctxt_t *ds_data; extern ds_ctxt_t *ds_data;
......
INSTALL SONAME 'auth_named_pipe';
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
GRANT ALL PRIVILEGES ON *.* to USERNAME;
DROP USER 'USERNAME';
UNINSTALL SONAME 'auth_named_pipe';
--source include/windows.inc
--source include/not_embedded.inc
if (!$AUTH_NAMED_PIPE_SO) {
skip No named pipe plugin;
}
if (!$USERNAME) {
skip USERNAME variable is undefined;
}
if (`SELECT count(*) <> 0 FROM mysql.user WHERE user = '$USERNAME'`) {
skip \$USER=$USER which exists in mysql.user;
}
INSTALL SONAME 'auth_named_pipe';
--replace_result $USERNAME USERNAME
eval CREATE USER '$USERNAME' IDENTIFIED WITH named_pipe;
--replace_result $USERNAME USERNAME
eval GRANT ALL PRIVILEGES ON *.* to $USERNAME;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf -u $USERNAME --backup --protocol=pipe --target-dir=$targetdir;
--enable_result_log
--replace_result $USERNAME USERNAME
eval DROP USER '$USERNAME';
rmdir $targetdir;
UNINSTALL SONAME 'auth_named_pipe';
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