Commit b8aa31c0 authored by unknown's avatar unknown

MWL#192 after-merge fixes.

Fix memory leak in one error case in mysqldump.
Fix that HAVE_VALGRIND_VALGRIND_H is now HAVE_VALGRIND in 5.5.
Fix that @have_ssl should not be set in embedded (introduced when
removing #undef HAVE_OPENSSL from my_global.h).
parent 9305f2b5
...@@ -1531,9 +1531,9 @@ static int connect_to_db(char *host, char *user,char *passwd) ...@@ -1531,9 +1531,9 @@ static int connect_to_db(char *host, char *user,char *passwd)
if (opt_default_auth && *opt_default_auth) if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth); mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd, mysql= &mysql_connection; /* So we can mysql_close() it properly */
NULL,opt_mysql_port,opt_mysql_unix_port, if (!mysql_real_connect(&mysql_connection,host,user,passwd,
0))) NULL,opt_mysql_port,opt_mysql_unix_port, 0))
{ {
DB_error(&mysql_connection, "when trying to connect"); DB_error(&mysql_connection, "when trying to connect");
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -60,7 +60,7 @@ struct my_context { ...@@ -60,7 +60,7 @@ struct my_context {
ucontext_t base_context; ucontext_t base_context;
ucontext_t spawned_context; ucontext_t spawned_context;
int active; int active;
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id; unsigned int valgrind_stack_id;
#endif #endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
...@@ -77,7 +77,7 @@ struct my_context { ...@@ -77,7 +77,7 @@ struct my_context {
uint64_t save[9]; uint64_t save[9];
void *stack_top; void *stack_top;
void *stack_bot; void *stack_bot;
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id; unsigned int valgrind_stack_id;
#endif #endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
...@@ -94,7 +94,7 @@ struct my_context { ...@@ -94,7 +94,7 @@ struct my_context {
uint64_t save[7]; uint64_t save[7];
void *stack_top; void *stack_top;
void *stack_bot; void *stack_bot;
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
unsigned int valgrind_stack_id; unsigned int valgrind_stack_id;
#endif #endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "m_string.h" #include "m_string.h"
#include "my_context.h" #include "my_context.h"
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
#include <valgrind/valgrind.h> #include <valgrind/valgrind.h>
#endif #endif
...@@ -134,7 +134,7 @@ my_context_init(struct my_context *c, size_t stack_size) ...@@ -134,7 +134,7 @@ my_context_init(struct my_context *c, size_t stack_size)
if (!(c->stack= malloc(stack_size))) if (!(c->stack= malloc(stack_size)))
return -1; /* Out of memory */ return -1; /* Out of memory */
c->stack_size= stack_size; c->stack_size= stack_size;
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
c->valgrind_stack_id= c->valgrind_stack_id=
VALGRIND_STACK_REGISTER(c->stack, ((unsigned char *)(c->stack))+stack_size); VALGRIND_STACK_REGISTER(c->stack, ((unsigned char *)(c->stack))+stack_size);
#endif #endif
...@@ -146,7 +146,7 @@ my_context_destroy(struct my_context *c) ...@@ -146,7 +146,7 @@ my_context_destroy(struct my_context *c)
{ {
if (c->stack) if (c->stack)
{ {
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id);
#endif #endif
free(c->stack); free(c->stack);
...@@ -384,7 +384,7 @@ my_context_init(struct my_context *c, size_t stack_size) ...@@ -384,7 +384,7 @@ my_context_init(struct my_context *c, size_t stack_size)
(( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16); (( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16);
bzero(c->stack_top, 16); bzero(c->stack_top, 16);
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
c->valgrind_stack_id= c->valgrind_stack_id=
VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top); VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top);
#endif #endif
...@@ -397,7 +397,7 @@ my_context_destroy(struct my_context *c) ...@@ -397,7 +397,7 @@ my_context_destroy(struct my_context *c)
if (c->stack_bot) if (c->stack_bot)
{ {
free(c->stack_bot); free(c->stack_bot);
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id);
#endif #endif
} }
...@@ -611,7 +611,7 @@ my_context_init(struct my_context *c, size_t stack_size) ...@@ -611,7 +611,7 @@ my_context_init(struct my_context *c, size_t stack_size)
(( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16); (( ((intptr)c->stack_bot + stack_size) & ~(intptr)0xf) - 16);
bzero(c->stack_top, 16); bzero(c->stack_top, 16);
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
c->valgrind_stack_id= c->valgrind_stack_id=
VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top); VALGRIND_STACK_REGISTER(c->stack_bot, c->stack_top);
#endif #endif
...@@ -624,7 +624,7 @@ my_context_destroy(struct my_context *c) ...@@ -624,7 +624,7 @@ my_context_destroy(struct my_context *c)
if (c->stack_bot) if (c->stack_bot)
{ {
free(c->stack_bot); free(c->stack_bot);
#ifdef HAVE_VALGRIND_VALGRIND_H #ifdef HAVE_VALGRIND
VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id); VALGRIND_STACK_DEREGISTER(c->valgrind_stack_id);
#endif #endif
} }
......
...@@ -1776,7 +1776,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , ...@@ -1776,7 +1776,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
const char *cipher __attribute__((unused))) const char *cipher __attribute__((unused)))
{ {
DBUG_ENTER("mysql_ssl_set"); DBUG_ENTER("mysql_ssl_set");
#ifdef HAVE_OPENSSL #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
my_free(mysql->options.ssl_key); my_free(mysql->options.ssl_key);
my_free(mysql->options.ssl_cert); my_free(mysql->options.ssl_cert);
my_free(mysql->options.ssl_ca); my_free(mysql->options.ssl_ca);
......
...@@ -3920,8 +3920,7 @@ static void openssl_lock(int mode, openssl_lock_t *lock, const char *file, ...@@ -3920,8 +3920,7 @@ static void openssl_lock(int mode, openssl_lock_t *lock, const char *file,
static void init_ssl() static void init_ssl()
{ {
#ifdef HAVE_OPENSSL #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
#ifndef EMBEDDED_LIBRARY
if (opt_use_ssl) if (opt_use_ssl)
{ {
enum enum_ssl_init_error error= SSL_INITERR_NOERROR; enum enum_ssl_init_error error= SSL_INITERR_NOERROR;
...@@ -3943,12 +3942,9 @@ static void init_ssl() ...@@ -3943,12 +3942,9 @@ static void init_ssl()
{ {
have_ssl= SHOW_OPTION_DISABLED; have_ssl= SHOW_OPTION_DISABLED;
} }
#else
have_ssl= SHOW_OPTION_DISABLED;
#endif /* ! EMBEDDED_LIBRARY */
if (des_key_file) if (des_key_file)
load_des_key_file(des_key_file); load_des_key_file(des_key_file);
#endif /* HAVE_OPENSSL */ #endif /* HAVE_OPENSSL && ! EMBEDDED_LIBRARY */
} }
...@@ -7236,7 +7232,7 @@ static int mysql_init_variables(void) ...@@ -7236,7 +7232,7 @@ static int mysql_init_variables(void)
have_profiling = SHOW_OPTION_NO; have_profiling = SHOW_OPTION_NO;
#endif #endif
#ifdef HAVE_OPENSSL #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
have_ssl=SHOW_OPTION_YES; have_ssl=SHOW_OPTION_YES;
#else #else
have_ssl=SHOW_OPTION_NO; have_ssl=SHOW_OPTION_NO;
......
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