Skip to content

Commit 1588e61

Browse files
vuvovasanja-byelkin
authored andcommitted
small cleanup: mysqltest
1 parent 84f99ac commit 1588e61

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

client/mysqltest.cc

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6172,56 +6172,52 @@ void do_connect(struct st_command *command)
61726172
while (*end && !my_isspace(charset_info, *end))
61736173
end++;
61746174
length= (size_t) (end - con_options);
6175-
if (length == 3 && !strncmp(con_options, "SSL", 3))
6175+
if (length == 3 && !strncmp(con_options, STRING_WITH_LEN("SSL")))
61766176
con_ssl= USE_SSL_REQUIRED;
6177-
else if (length == 5 && !strncmp(con_options, "NOSSL", 5))
6177+
else if (length == 5 && !strncmp(con_options, STRING_WITH_LEN("NOSSL")))
61786178
con_ssl= USE_SSL_FORBIDDEN;
61796179
else if (!strncmp(con_options, "SSL-CIPHER=", 11))
61806180
{
61816181
con_ssl= USE_SSL_REQUIRED;
61826182
ssl_cipher=con_options + 11;
61836183
}
6184-
else if (length == 8 && !strncmp(con_options, "COMPRESS", 8))
6184+
else if (length == 8 && !strncmp(con_options, STRING_WITH_LEN("COMPRESS")))
61856185
con_compress= 1;
6186-
else if (length == 3 && !strncmp(con_options, "TCP", 3))
6186+
else if (length == 3 && !strncmp(con_options, STRING_WITH_LEN("TCP")))
61876187
protocol= MYSQL_PROTOCOL_TCP;
6188-
else if (length == 7 && !strncmp(con_options, "DEFAULT", 7))
6188+
else if (length == 7 && !strncmp(con_options, STRING_WITH_LEN("DEFAULT")))
61896189
protocol= MYSQL_PROTOCOL_DEFAULT;
6190-
else if (length == 4 && !strncmp(con_options, "PIPE", 4))
6190+
else if (length == 4 && !strncmp(con_options, STRING_WITH_LEN("PIPE")))
61916191
{
61926192
#ifdef _WIN32
61936193
protocol= MYSQL_PROTOCOL_PIPE;
61946194
#endif
61956195
}
6196-
else if (length == 6 && !strncmp(con_options, "SOCKET", 6))
6196+
else if (length == 6 && !strncmp(con_options, STRING_WITH_LEN("SOCKET")))
61976197
{
61986198
#ifndef _WIN32
61996199
protocol= MYSQL_PROTOCOL_SOCKET;
62006200
#endif
62016201
}
6202-
else if (length == 6 && !strncmp(con_options, "MEMORY", 6))
6202+
else if (length == 6 && !strncmp(con_options, STRING_WITH_LEN("MEMORY")))
62036203
{
62046204
#ifdef _WIN32
62056205
protocol= MYSQL_PROTOCOL_MEMORY;
62066206
#endif
62076207
}
6208-
else if (strncasecmp(con_options, "read_timeout=",
6209-
sizeof("read_timeout=")-1) == 0)
6208+
else if (strncasecmp(con_options, STRING_WITH_LEN("read_timeout=")) == 0)
62106209
{
62116210
read_timeout= atoi(con_options + sizeof("read_timeout=")-1);
62126211
}
6213-
else if (strncasecmp(con_options, "write_timeout=",
6214-
sizeof("write_timeout=")-1) == 0)
6212+
else if (strncasecmp(con_options, STRING_WITH_LEN("write_timeout=")) == 0)
62156213
{
62166214
write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
62176215
}
6218-
else if (strncasecmp(con_options, "connect_timeout=",
6219-
sizeof("connect_timeout=")-1) == 0)
6216+
else if (strncasecmp(con_options, STRING_WITH_LEN("connect_timeout=")) == 0)
62206217
{
62216218
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
62226219
}
6223-
else if (strncasecmp(con_options, "CHARSET=",
6224-
sizeof("CHARSET=") - 1) == 0)
6220+
else if (strncasecmp(con_options, STRING_WITH_LEN("CHARSET=")) == 0)
62256221
{
62266222
csname= strdup(con_options + sizeof("CHARSET=") - 1);
62276223
}

0 commit comments

Comments
 (0)