mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
small cleanup: mysqltest
This commit is contained in:
parent
594bd86e3e
commit
5d74e43914
1 changed files with 12 additions and 16 deletions
|
@ -6108,56 +6108,52 @@ void do_connect(struct st_command *command)
|
||||||
while (*end && !my_isspace(charset_info, *end))
|
while (*end && !my_isspace(charset_info, *end))
|
||||||
end++;
|
end++;
|
||||||
length= (size_t) (end - con_options);
|
length= (size_t) (end - con_options);
|
||||||
if (length == 3 && !strncmp(con_options, "SSL", 3))
|
if (length == 3 && !strncmp(con_options, STRING_WITH_LEN("SSL")))
|
||||||
con_ssl= USE_SSL_REQUIRED;
|
con_ssl= USE_SSL_REQUIRED;
|
||||||
else if (length == 5 && !strncmp(con_options, "NOSSL", 5))
|
else if (length == 5 && !strncmp(con_options, STRING_WITH_LEN("NOSSL")))
|
||||||
con_ssl= USE_SSL_FORBIDDEN;
|
con_ssl= USE_SSL_FORBIDDEN;
|
||||||
else if (!strncmp(con_options, "SSL-CIPHER=", 11))
|
else if (!strncmp(con_options, "SSL-CIPHER=", 11))
|
||||||
{
|
{
|
||||||
con_ssl= USE_SSL_REQUIRED;
|
con_ssl= USE_SSL_REQUIRED;
|
||||||
ssl_cipher=con_options + 11;
|
ssl_cipher=con_options + 11;
|
||||||
}
|
}
|
||||||
else if (length == 8 && !strncmp(con_options, "COMPRESS", 8))
|
else if (length == 8 && !strncmp(con_options, STRING_WITH_LEN("COMPRESS")))
|
||||||
con_compress= 1;
|
con_compress= 1;
|
||||||
else if (length == 3 && !strncmp(con_options, "TCP", 3))
|
else if (length == 3 && !strncmp(con_options, STRING_WITH_LEN("TCP")))
|
||||||
protocol= MYSQL_PROTOCOL_TCP;
|
protocol= MYSQL_PROTOCOL_TCP;
|
||||||
else if (length == 7 && !strncmp(con_options, "DEFAULT", 7))
|
else if (length == 7 && !strncmp(con_options, STRING_WITH_LEN("DEFAULT")))
|
||||||
protocol= MYSQL_PROTOCOL_DEFAULT;
|
protocol= MYSQL_PROTOCOL_DEFAULT;
|
||||||
else if (length == 4 && !strncmp(con_options, "PIPE", 4))
|
else if (length == 4 && !strncmp(con_options, STRING_WITH_LEN("PIPE")))
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
protocol= MYSQL_PROTOCOL_PIPE;
|
protocol= MYSQL_PROTOCOL_PIPE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (length == 6 && !strncmp(con_options, "SOCKET", 6))
|
else if (length == 6 && !strncmp(con_options, STRING_WITH_LEN("SOCKET")))
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
protocol= MYSQL_PROTOCOL_SOCKET;
|
protocol= MYSQL_PROTOCOL_SOCKET;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (length == 6 && !strncmp(con_options, "MEMORY", 6))
|
else if (length == 6 && !strncmp(con_options, STRING_WITH_LEN("MEMORY")))
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
protocol= MYSQL_PROTOCOL_MEMORY;
|
protocol= MYSQL_PROTOCOL_MEMORY;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (strncasecmp(con_options, "read_timeout=",
|
else if (strncasecmp(con_options, STRING_WITH_LEN("read_timeout=")) == 0)
|
||||||
sizeof("read_timeout=")-1) == 0)
|
|
||||||
{
|
{
|
||||||
read_timeout= atoi(con_options + sizeof("read_timeout=")-1);
|
read_timeout= atoi(con_options + sizeof("read_timeout=")-1);
|
||||||
}
|
}
|
||||||
else if (strncasecmp(con_options, "write_timeout=",
|
else if (strncasecmp(con_options, STRING_WITH_LEN("write_timeout=")) == 0)
|
||||||
sizeof("write_timeout=")-1) == 0)
|
|
||||||
{
|
{
|
||||||
write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
|
write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
|
||||||
}
|
}
|
||||||
else if (strncasecmp(con_options, "connect_timeout=",
|
else if (strncasecmp(con_options, STRING_WITH_LEN("connect_timeout=")) == 0)
|
||||||
sizeof("connect_timeout=")-1) == 0)
|
|
||||||
{
|
{
|
||||||
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
|
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
|
||||||
}
|
}
|
||||||
else if (strncasecmp(con_options, "CHARSET=",
|
else if (strncasecmp(con_options, STRING_WITH_LEN("CHARSET=")) == 0)
|
||||||
sizeof("CHARSET=") - 1) == 0)
|
|
||||||
{
|
{
|
||||||
csname= strdup(con_options + sizeof("CHARSET=") - 1);
|
csname= strdup(con_options + sizeof("CHARSET=") - 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue