summaryrefslogtreecommitdiff
path: root/client/mysqlcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqlcheck.c')
-rw-r--r--client/mysqlcheck.c60
1 files changed, 7 insertions, 53 deletions
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 0a5a4e1a446..6076a8cddaa 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -57,8 +57,6 @@ DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
DYNAMIC_ARRAY views4repair;
static uint opt_protocol=0;
-static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
-
enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_FIX_NAMES };
const char *operation_name[]=
{
@@ -283,10 +281,6 @@ get_one_option(const struct my_option *opt,
const char *filename)
{
int orig_what_to_do= what_to_do;
-
- /* Track when protocol is set via CLI to not force overrides */
- static my_bool ignore_protocol_override = FALSE;
-
DBUG_ENTER("get_one_option");
switch(opt->id) {
@@ -349,13 +343,6 @@ get_one_option(const struct my_option *opt,
case 'W':
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
-
- /* Prioritize pipe if explicit via command line */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
#endif
break;
case '#':
@@ -379,45 +366,19 @@ get_one_option(const struct my_option *opt,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
-
- /* Specification of protocol via CLI trumps implicit overrides */
- if (filename[0] == '\0')
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
break;
case 'P':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* If port is set via CLI, try to force protocol to TCP */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = MYSQL_PROTOCOL_TCP;
+ /* Port given on command line, switch protocol to use TCP */
+ opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
- /* If port and socket are set, fall back to default behavior */
- if (protocol_to_force == MYSQL_PROTOCOL_TCP)
- {
- ignore_protocol_override = TRUE;
- protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
- }
-
- /* Prioritize socket if set via command line */
- if (filename[0] == '\0' &&
- !ignore_protocol_override &&
- protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
+ if (filename[0] == '\0')
{
- protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
+ /* Socket given on command line, switch protocol to use SOCKETSt */
+ opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
}
@@ -994,6 +955,7 @@ static int handle_request_for_tables(char *tables, size_t length,
DBUG_RETURN(1);
if (dont_quote)
{
+ DBUG_ASSERT(op);
DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
/* No backticks here as we added them before */
@@ -1240,14 +1202,6 @@ int main(int argc, char **argv)
if (get_options(&argc, &argv))
goto end1;
-
- /* Command line options override configured protocol */
- if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
- && protocol_to_force != opt_protocol)
- {
- warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
- }
-
sf_leaking_memory=0; /* from now on we cleanup properly */
ret= EX_MYSQLERR;