diff options
-rw-r--r-- | client/mysqltest.c | 9 | ||||
-rw-r--r-- | sql/mysqld.cc | 26 | ||||
-rw-r--r-- | sql/slave.cc | 4 | ||||
-rw-r--r-- | vio/viossl.c | 40 |
4 files changed, 39 insertions, 40 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 2727c936955..f6d87352a6c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -245,6 +245,15 @@ static char *out_buff; static uint out_length; static int eval_result = 0; +/* Disable functions that only exist in MySQL 4.0 */ +#if MYSQL_VERSION_ID < 40000 +static void mysql_enable_rpl_parse(MYSQL* mysql) {} +static void mysql_disable_rpl_parse(MYSQL* mysql) {} +static int mysql_rpl_parse_enabled(MYSQL* mysql) { return 1; } +static int mysql_rpl_probe(MYSQL *mysql) { return 1; } +#endif + + static void do_eval(DYNAMIC_STRING* query_eval, const char* query) { const char* p; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 77ee1890a42..5efeb59c17e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -702,26 +702,12 @@ void clean_up(bool print_message) end_raid(); #endif #ifdef HAVE_OPENSSL - if(opt_ssl_key) { - my_free(opt_ssl_key,MYF(0)); - opt_ssl_key=0; - } - if(opt_ssl_cert) { - my_free(opt_ssl_cert,MYF(0)); - opt_ssl_cert=0; - } - if(opt_ssl_ca) { - my_free(opt_ssl_ca,MYF(0)); - opt_ssl_ca=0; - } - if(opt_ssl_capath) { - my_free(opt_ssl_capath,MYF(0)); - opt_ssl_capath=0; - } - if(ssl_acceptor_fd) { - my_free((gptr)ssl_acceptor_fd,MYF(0)); - ssl_acceptor_fd=0; - } + my_free(opt_ssl_key,MYF(MYF_ALLOW_ZERO_PTR)); + my_free(opt_ssl_cert,MYF(MYF_ALLOW_ZERO_PTR)); + my_free(opt_ssl_ca,MYF(MYF_ALLOW_ZERO_PTR)); + my_free(opt_ssl_capath,MYF(MYF_ALLOW_ZERO_PTR)); + my_free(opt_ssl_accceptor,MYF(MYF_ALLOW_ZERO_PTR)); + opt_ssl_key=opt_ssl_cert=opt_ssl_ca=opt_ssl_capath=opt_ssl_acceptor=0; #endif /* HAVE_OPENSSL */ free_defaults(defaults_argv); my_free(charsets_list, MYF(MY_ALLOW_ZERO_PTR)); diff --git a/sql/slave.cc b/sql/slave.cc index e5da79d6871..27637107b11 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -664,9 +664,9 @@ int show_master_info(THD* thd) net_store_data(packet, (longlong) glob_mi.pos); last_log_seq = glob_mi.last_log_seq; pthread_mutex_unlock(&glob_mi.lock); - pthread_mutex_lock(&LOCK_slave); + pthread_mutex_lock(&LOCK_slave); // QQ; This is not needed net_store_data(packet, slave_running ? "Yes":"No"); - pthread_mutex_unlock(&LOCK_slave); + pthread_mutex_unlock(&LOCK_slave); // QQ; This is not needed net_store_data(packet, &replicate_do_db); net_store_data(packet, &replicate_ignore_db); net_store_data(packet, (uint32)last_slave_errno); diff --git a/vio/viossl.c b/vio/viossl.c index b9883ba3fa6..50d46689ba5 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -105,10 +105,12 @@ int vio_ssl_read(Vio * vio, gptr buf, int size) { int r; DBUG_ENTER("vio_ssl_read"); - DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d, ssl_=%p", vio->sd, buf, size, vio->ssl_)); - assert(vio->ssl_!= 0); + DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d, ssl_=%p", + vio->sd, buf, size, vio->ssl_)); + DBUG_ASSERT(vio->ssl_!= 0); - DBUG_PRINT("info",("SSL_get_cipher_name() = '%s'",SSL_get_cipher_name(vio->ssl_))); + DBUG_PRINT("info",("SSL_get_cipher_name() = '%s'" + ,SSL_get_cipher_name(vio->ssl_))); r = SSL_read(vio->ssl_, buf, size); #ifndef DBUG_OFF @@ -125,8 +127,9 @@ int vio_ssl_write(Vio * vio, const gptr buf, int size) int r; DBUG_ENTER("vio_ssl_write"); DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); - assert(vio->ssl_!=0); - DBUG_PRINT("info",("SSL_get_cipher_name() = '%s'",SSL_get_cipher_name(vio->ssl_))); + DBUG_ASSERT(vio->ssl_!=0); + DBUG_PRINT("info",("SSL_get_cipher_name() = '%s'", + SSL_get_cipher_name(vio->ssl_))); r = SSL_write(vio->ssl_, buf, size); #ifndef DBUG_OFF if (r<0) @@ -301,12 +304,11 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* sd) DBUG_ENTER("sslaccept"); DBUG_PRINT("enter", ("sd=%s ptr=%p", sd->sd,ptr)); vio_reset(sd,VIO_TYPE_SSL,sd->sd,0,FALSE); -// ptr->bio_=0; sd->ssl_=0; sd->open_=FALSE; - assert(sd != 0); - assert(ptr != 0); - assert(ptr->ssl_context_ != 0); + DBUG_ASSERT(sd != 0); + DBUG_ASSERT(ptr != 0); + DBUG_ASSERT(ptr->ssl_context_ != 0); if (!(sd->ssl_ = SSL_new(ptr->ssl_context_))) { DBUG_PRINT("error", ("SSL_new failure")); @@ -315,7 +317,7 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* sd) } DBUG_PRINT("info", ("ssl_=%p",sd->ssl_)); SSL_set_fd(sd->ssl_,sd->sd); -// SSL_accept(sd->ssl_); +/* SSL_accept(sd->ssl_); */ /* if (!(ptr->bio_ = BIO_new_socket(sd->sd, BIO_NOCLOSE))) { DBUG_PRINT("error", ("BIO_new_socket failure")); @@ -326,8 +328,10 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* sd) } SSL_set_bio(sd->ssl_, ptr->bio_, ptr->bio_);*/ SSL_set_accept_state(sd->ssl_); -// sprintf(ptr->desc_, "VioSSL(%d)", sd->sd); -// sd->ssl_cip_ = SSL_get_cipher(sd->ssl_); +/* + sprintf(ptr->desc_, "VioSSL(%d)", sd->sd); + sd->ssl_cip_ = SSL_get_cipher(sd->ssl_); +*/ sd->open_ = TRUE; @@ -335,12 +339,12 @@ void sslaccept(struct st_VioSSLAcceptorFd* ptr, Vio* sd) if (client_cert != NULL) { DBUG_PRINT("info",("Client certificate:")); str = X509_NAME_oneline (X509_get_subject_name (client_cert), 0, 0); - //CHK_NULL(str); + /* CHK_NULL(str); */ DBUG_PRINT("info",("\t subject: %s", str)); free (str); str = X509_NAME_oneline (X509_get_issuer_name (client_cert), 0, 0); - //CHK_NULL(str); + /* CHK_NULL(str); */ DBUG_PRINT("info",("\t issuer: %s", str)); free (str); @@ -365,9 +369,9 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd) sd->bio_=0; sd->ssl_=0; sd->open_=FALSE; - assert(sd != 0); - assert(ptr != 0); - assert(ptr->ssl_context_ != 0); + DBUG_ASSERT(sd != 0); + DBUG_ASSERT(ptr != 0); + DBUG_ASSERT(ptr->ssl_context_ != 0); if (!(sd->ssl_ = SSL_new(ptr->ssl_context_))) { @@ -408,7 +412,7 @@ void sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd) } else DBUG_PRINT("info",("Server does not have certificate.")); -// sd->ssl_cip_ = SSL_get_cipher(sd->ssl_); + /* sd->ssl_cip_ = SSL_get_cipher(sd->ssl_); */ sd->open_ = TRUE; DBUG_VOID_RETURN; } |