@@ -6172,56 +6172,52 @@ void do_connect(struct st_command *command)
6172
6172
while (*end && !my_isspace (charset_info, *end))
6173
6173
end++;
6174
6174
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" ) ))
6176
6176
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" ) ))
6178
6178
con_ssl= USE_SSL_FORBIDDEN;
6179
6179
else if (!strncmp (con_options, " SSL-CIPHER=" , 11 ))
6180
6180
{
6181
6181
con_ssl= USE_SSL_REQUIRED;
6182
6182
ssl_cipher=con_options + 11 ;
6183
6183
}
6184
- else if (length == 8 && !strncmp (con_options, " COMPRESS" , 8 ))
6184
+ else if (length == 8 && !strncmp (con_options, STRING_WITH_LEN ( " COMPRESS" ) ))
6185
6185
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" ) ))
6187
6187
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" ) ))
6189
6189
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" ) ))
6191
6191
{
6192
6192
#ifdef _WIN32
6193
6193
protocol= MYSQL_PROTOCOL_PIPE;
6194
6194
#endif
6195
6195
}
6196
- else if (length == 6 && !strncmp (con_options, " SOCKET" , 6 ))
6196
+ else if (length == 6 && !strncmp (con_options, STRING_WITH_LEN ( " SOCKET" ) ))
6197
6197
{
6198
6198
#ifndef _WIN32
6199
6199
protocol= MYSQL_PROTOCOL_SOCKET;
6200
6200
#endif
6201
6201
}
6202
- else if (length == 6 && !strncmp (con_options, " MEMORY" , 6 ))
6202
+ else if (length == 6 && !strncmp (con_options, STRING_WITH_LEN ( " MEMORY" ) ))
6203
6203
{
6204
6204
#ifdef _WIN32
6205
6205
protocol= MYSQL_PROTOCOL_MEMORY;
6206
6206
#endif
6207
6207
}
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 )
6210
6209
{
6211
6210
read_timeout= atoi (con_options + sizeof (" read_timeout=" )-1 );
6212
6211
}
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 )
6215
6213
{
6216
6214
write_timeout= atoi (con_options + sizeof (" write_timeout=" )-1 );
6217
6215
}
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 )
6220
6217
{
6221
6218
connect_timeout= atoi (con_options + sizeof (" connect_timeout=" )-1 );
6222
6219
}
6223
- else if (strncasecmp (con_options, " CHARSET=" ,
6224
- sizeof (" CHARSET=" ) - 1 ) == 0 )
6220
+ else if (strncasecmp (con_options, STRING_WITH_LEN (" CHARSET=" )) == 0 )
6225
6221
{
6226
6222
csname= strdup (con_options + sizeof (" CHARSET=" ) - 1 );
6227
6223
}
0 commit comments