Commit 100e92f4 authored by unknown's avatar unknown

Bug #11286 yassl incompatible with "load data infile"

 - Make sure that mysqltest always uses ssl when connecting to the server.
 - Pass a i32-bit int variable as argument to FIONREAD ioctl.


client/mysqltest.c:
  Set the flag CLIENT_REMENBER_OPTIONS so that all connection attempts from mysqltest is done with the same settings.
  Old impl caused mysqltest to loose all it's settings in the second connection attempt, ex ssl settings.
extra/yassl/src/socket_wrapper.cpp:
  64-bit Solaris requires the variable passed to FIONREAD be a 32-bit value.
  Using "int" unless _WIN32_ is defined.
sql/sql_parse.cc:
  Update error message when sslaccepts fails. Must have been a copy and paste error.
vio/viossl.c:
  Minor fixes
  Add timeout to DBUG_PRINT
  use function vio_ssl_fd to get sd from vio
  Remove extra whitespace
vio/viosslfactories.c:
  Remove DBUG_PRINT("enter" in sslaccept and sslconnect as it tries to print out null strings. That is not suported on all platforms.
parent 43e07c3b
...@@ -1741,7 +1741,7 @@ int safe_connect(MYSQL* con, const char* host, const char* user, ...@@ -1741,7 +1741,7 @@ int safe_connect(MYSQL* con, const char* host, const char* user,
for (i = 0; i < MAX_CON_TRIES; ++i) for (i = 0; i < MAX_CON_TRIES; ++i)
{ {
if (mysql_real_connect(con, host,user, pass, db, port, sock, if (mysql_real_connect(con, host,user, pass, db, port, sock,
CLIENT_MULTI_STATEMENTS)) CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
{ {
con_error = 0; con_error = 0;
break; break;
......
...@@ -93,11 +93,15 @@ void Socket::closeSocket() ...@@ -93,11 +93,15 @@ void Socket::closeSocket()
uint Socket::get_ready() const uint Socket::get_ready() const
{ {
unsigned long ready = 0;
#ifdef _WIN32 #ifdef _WIN32
unsigned long ready = 0;
ioctlsocket(socket_, FIONREAD, &ready); ioctlsocket(socket_, FIONREAD, &ready);
#else #else
/*
64-bit Solaris requires the variable passed to
FIONREAD be a 32-bit value.
*/
int ready = 0;
ioctl(socket_, FIONREAD, &ready); ioctl(socket_, FIONREAD, &ready);
#endif #endif
......
...@@ -919,8 +919,7 @@ static int check_connection(THD *thd) ...@@ -919,8 +919,7 @@ static int check_connection(THD *thd)
DBUG_PRINT("info", ("IO layer change in progress...")); DBUG_PRINT("info", ("IO layer change in progress..."));
if (sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout)) if (sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout))
{ {
DBUG_PRINT("error", ("Failed to read user information (pkt_len= %lu)", DBUG_PRINT("error", ("Failed to accept new SSL connection"));
pkt_len));
inc_host_errors(&thd->remote.sin_addr); inc_host_errors(&thd->remote.sin_addr);
return(ER_HANDSHAKE_ERROR); return(ER_HANDSHAKE_ERROR);
} }
...@@ -3449,7 +3448,7 @@ end_with_restore_list: ...@@ -3449,7 +3448,7 @@ end_with_restore_list:
if (lex->local_file) if (lex->local_file)
{ {
if (!(thd->client_capabilities & CLIENT_LOCAL_FILES) || if (!(thd->client_capabilities & CLIENT_LOCAL_FILES) ||
! opt_local_infile) !opt_local_infile)
{ {
my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND), MYF(0)); my_message(ER_NOT_ALLOWED_COMMAND, ER(ER_NOT_ALLOWED_COMMAND), MYF(0));
goto error; goto error;
......
...@@ -283,9 +283,10 @@ int sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout) ...@@ -283,9 +283,10 @@ int sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* vio, long timeout)
X509* client_cert; X509* client_cert;
my_bool unused; my_bool unused;
my_bool net_blocking; my_bool net_blocking;
enum enum_vio_type old_type; enum enum_vio_type old_type;
DBUG_ENTER("sslaccept"); DBUG_ENTER("sslaccept");
DBUG_PRINT("enter", ("sd: %d ptr: Ox%p", vio->sd,ptr)); DBUG_PRINT("enter", ("sd: %d ptr: Ox%p, timeout: %d",
vio->sd, ptr, timeout));
old_type= vio->type; old_type= vio->type;
net_blocking = vio_is_blocking(vio); net_blocking = vio_is_blocking(vio);
...@@ -379,7 +380,7 @@ int sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout) ...@@ -379,7 +380,7 @@ int sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* vio, long timeout)
(SSL*) vio->ssl_arg, timeout)); (SSL*) vio->ssl_arg, timeout));
SSL_clear((SSL*) vio->ssl_arg); SSL_clear((SSL*) vio->ssl_arg);
SSL_SESSION_set_timeout(SSL_get_session((SSL*) vio->ssl_arg), timeout); SSL_SESSION_set_timeout(SSL_get_session((SSL*) vio->ssl_arg), timeout);
SSL_set_fd ((SSL*) vio->ssl_arg, vio->sd); SSL_set_fd ((SSL*) vio->ssl_arg, vio_ssl_fd(vio));
SSL_set_connect_state((SSL*) vio->ssl_arg); SSL_set_connect_state((SSL*) vio->ssl_arg);
if (SSL_do_handshake((SSL*) vio->ssl_arg) < 1) if (SSL_do_handshake((SSL*) vio->ssl_arg) < 1)
{ {
......
...@@ -219,9 +219,6 @@ new_VioSSLConnectorFd(const char* key_file, ...@@ -219,9 +219,6 @@ new_VioSSLConnectorFd(const char* key_file,
int result; int result;
DH *dh; DH *dh;
DBUG_ENTER("new_VioSSLConnectorFd"); DBUG_ENTER("new_VioSSLConnectorFd");
DBUG_PRINT("enter",
("key_file: %s, cert_file: %s, ca_path: %s, ca_file: %s, cipher: %s",
key_file, cert_file, ca_path, ca_file, cipher));
if (!(ptr=((struct st_VioSSLConnectorFd*) if (!(ptr=((struct st_VioSSLConnectorFd*)
my_malloc(sizeof(struct st_VioSSLConnectorFd),MYF(0))))) my_malloc(sizeof(struct st_VioSSLConnectorFd),MYF(0)))))
...@@ -314,9 +311,6 @@ new_VioSSLAcceptorFd(const char *key_file, ...@@ -314,9 +311,6 @@ new_VioSSLAcceptorFd(const char *key_file,
int result; int result;
DH *dh; DH *dh;
DBUG_ENTER("new_VioSSLAcceptorFd"); DBUG_ENTER("new_VioSSLAcceptorFd");
DBUG_PRINT("enter",
("key_file: %s, cert_file: %s, ca_path: %s, ca_file: %s, cipher: %s",
key_file, cert_file, ca_path, ca_file, cipher));
ptr= ((struct st_VioSSLAcceptorFd*) ptr= ((struct st_VioSSLAcceptorFd*)
my_malloc(sizeof(struct st_VioSSLAcceptorFd),MYF(0))); my_malloc(sizeof(struct st_VioSSLAcceptorFd),MYF(0)));
......
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