Commit e44fefc7 authored by Sergei Golubchik's avatar Sergei Golubchik

adding DBUG_ENTER/DBUG_RETURN tags that were useful when fixing memory leaks

parent 49501b4c
This diff is collapsed.
...@@ -44,7 +44,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, ...@@ -44,7 +44,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
void *init_buffer, uint init_alloc, void *init_buffer, uint init_alloc,
uint alloc_increment) uint alloc_increment)
{ {
DBUG_ENTER("init_dynamic_array"); DBUG_ENTER("init_dynamic_array2");
if (!alloc_increment) if (!alloc_increment)
{ {
alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16); alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16);
......
...@@ -1198,10 +1198,11 @@ static const char **init_default_directories(MEM_ROOT *alloc) ...@@ -1198,10 +1198,11 @@ static const char **init_default_directories(MEM_ROOT *alloc)
const char **dirs; const char **dirs;
char *env; char *env;
int errors= 0; int errors= 0;
DBUG_ENTER("init_default_directories");
dirs= (const char **)alloc_root(alloc, DEFAULT_DIRS_SIZE * sizeof(char *)); dirs= (const char **)alloc_root(alloc, DEFAULT_DIRS_SIZE * sizeof(char *));
if (dirs == NULL) if (dirs == NULL)
return NULL; DBUG_RETURN(NULL);
bzero((char *) dirs, DEFAULT_DIRS_SIZE * sizeof(char *)); bzero((char *) dirs, DEFAULT_DIRS_SIZE * sizeof(char *));
#ifdef __WIN__ #ifdef __WIN__
...@@ -1242,5 +1243,5 @@ static const char **init_default_directories(MEM_ROOT *alloc) ...@@ -1242,5 +1243,5 @@ static const char **init_default_directories(MEM_ROOT *alloc)
errors += add_directory(alloc, "~/", dirs); errors += add_directory(alloc, "~/", dirs);
#endif #endif
return (errors > 0 ? NULL : dirs); DBUG_RETURN(errors > 0 ? NULL : dirs);
} }
...@@ -77,6 +77,7 @@ _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, ...@@ -77,6 +77,7 @@ _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
my_hash_get_key get_key, my_hash_get_key get_key,
void (*free_element)(void*), uint flags) void (*free_element)(void*), uint flags)
{ {
my_bool res;
DBUG_ENTER("my_hash_init"); DBUG_ENTER("my_hash_init");
DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size)); DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size));
...@@ -88,8 +89,9 @@ _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, ...@@ -88,8 +89,9 @@ _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset,
hash->free=free_element; hash->free=free_element;
hash->flags=flags; hash->flags=flags;
hash->charset=charset; hash->charset=charset;
DBUG_RETURN(my_init_dynamic_array_ci(&hash->array, res= my_init_dynamic_array_ci(&hash->array,
sizeof(HASH_LINK), size, growth_size)); sizeof(HASH_LINK), size, growth_size);
DBUG_RETURN(res);
} }
......
This diff is collapsed.
...@@ -115,9 +115,11 @@ void my_free(void *ptr) ...@@ -115,9 +115,11 @@ void my_free(void *ptr)
void *my_memdup(const void *from, size_t length, myf my_flags) void *my_memdup(const void *from, size_t length, myf my_flags)
{ {
void *ptr; void *ptr;
DBUG_ENTER("my_memdup");
if ((ptr= my_malloc(length,my_flags)) != 0) if ((ptr= my_malloc(length,my_flags)) != 0)
memcpy(ptr, from, length); memcpy(ptr, from, length);
return ptr; DBUG_RETURN(ptr);
} }
...@@ -125,20 +127,24 @@ char *my_strdup(const char *from, myf my_flags) ...@@ -125,20 +127,24 @@ char *my_strdup(const char *from, myf my_flags)
{ {
char *ptr; char *ptr;
size_t length= strlen(from)+1; size_t length= strlen(from)+1;
DBUG_ENTER("my_strdup");
if ((ptr= (char*) my_malloc(length, my_flags))) if ((ptr= (char*) my_malloc(length, my_flags)))
memcpy(ptr, from, length); memcpy(ptr, from, length);
return ptr; DBUG_RETURN(ptr);
} }
char *my_strndup(const char *from, size_t length, myf my_flags) char *my_strndup(const char *from, size_t length, myf my_flags)
{ {
char *ptr; char *ptr;
DBUG_ENTER("my_strndup");
if ((ptr= (char*) my_malloc(length+1, my_flags))) if ((ptr= (char*) my_malloc(length+1, my_flags)))
{ {
memcpy(ptr, from, length); memcpy(ptr, from, length);
ptr[length]= 0; ptr[length]= 0;
} }
return ptr; DBUG_RETURN(ptr);
} }
...@@ -49,8 +49,9 @@ File my_open(const char *FileName, int Flags, myf MyFlags) ...@@ -49,8 +49,9 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
fd = open((char *) FileName, Flags); fd = open((char *) FileName, Flags);
#endif #endif
DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_OPEN, fd= my_register_filename(fd, FileName, FILE_BY_OPEN,
EE_FILENOTFOUND, MyFlags)); EE_FILENOTFOUND, MyFlags);
DBUG_RETURN(fd);
} /* my_open */ } /* my_open */
......
...@@ -98,20 +98,21 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, ...@@ -98,20 +98,21 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
size_t length) size_t length)
{ {
char *new_ptr; char *new_ptr;
DBUG_ENTER("dynstr_append_mem");
if (str->length+length >= str->max_length) if (str->length+length >= str->max_length)
{ {
size_t new_length=(str->length+length+str->alloc_increment)/ size_t new_length=(str->length+length+str->alloc_increment)/
str->alloc_increment; str->alloc_increment;
new_length*=str->alloc_increment; new_length*=str->alloc_increment;
if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME)))) if (!(new_ptr=(char*) my_realloc(str->str,new_length,MYF(MY_WME))))
return TRUE; DBUG_RETURN(TRUE);
str->str=new_ptr; str->str=new_ptr;
str->max_length=new_length; str->max_length=new_length;
} }
memcpy(str->str + str->length,append,length); memcpy(str->str + str->length,append,length);
str->length+=length; str->length+=length;
str->str[str->length]=0; /* Safety for C programs */ str->str[str->length]=0; /* Safety for C programs */
return FALSE; DBUG_RETURN(FALSE);
} }
......
...@@ -4050,7 +4050,7 @@ mysql_fetch_lengths(MYSQL_RES *res) ...@@ -4050,7 +4050,7 @@ mysql_fetch_lengths(MYSQL_RES *res)
int STDCALL int STDCALL
mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
{ {
DBUG_ENTER("mysql_option"); DBUG_ENTER("mysql_options");
DBUG_PRINT("enter",("option: %d",(int) option)); DBUG_PRINT("enter",("option: %d",(int) option));
switch (option) { switch (option) {
case MYSQL_OPT_CONNECT_TIMEOUT: case MYSQL_OPT_CONNECT_TIMEOUT:
......
...@@ -68,13 +68,15 @@ static pthread_mutex_t LOCK_load_client_plugin; ...@@ -68,13 +68,15 @@ static pthread_mutex_t LOCK_load_client_plugin;
static int is_not_initialized(MYSQL *mysql, const char *name) static int is_not_initialized(MYSQL *mysql, const char *name)
{ {
DBUG_ENTER("is_not_initialized");
if (initialized) if (initialized)
return 0; DBUG_RETURN(0);
set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD,
unknown_sqlstate, ER(CR_AUTH_PLUGIN_CANNOT_LOAD), unknown_sqlstate, ER(CR_AUTH_PLUGIN_CANNOT_LOAD),
name, "not initialized"); name, "not initialized");
return 1; DBUG_RETURN(1);
} }
/** /**
...@@ -91,18 +93,19 @@ static struct st_mysql_client_plugin * ...@@ -91,18 +93,19 @@ static struct st_mysql_client_plugin *
find_plugin(const char *name, int type) find_plugin(const char *name, int type)
{ {
struct st_client_plugin_int *p; struct st_client_plugin_int *p;
DBUG_ENTER("find_plugin");
DBUG_ASSERT(initialized); DBUG_ASSERT(initialized);
DBUG_ASSERT(type >= 0 && type < MYSQL_CLIENT_MAX_PLUGINS); DBUG_ASSERT(type >= 0 && type < MYSQL_CLIENT_MAX_PLUGINS);
if (type < 0 || type >= MYSQL_CLIENT_MAX_PLUGINS) if (type < 0 || type >= MYSQL_CLIENT_MAX_PLUGINS)
return 0; DBUG_RETURN(0);
for (p= plugin_list[type]; p; p= p->next) for (p= plugin_list[type]; p; p= p->next)
{ {
if (strcmp(p->plugin->name, name) == 0) if (strcmp(p->plugin->name, name) == 0)
return p->plugin; DBUG_RETURN(p->plugin);
} }
return NULL; DBUG_RETURN(NULL);
} }
/** /**
...@@ -124,6 +127,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, ...@@ -124,6 +127,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
const char *errmsg; const char *errmsg;
struct st_client_plugin_int plugin_int, *p; struct st_client_plugin_int plugin_int, *p;
char errbuf[1024]; char errbuf[1024];
DBUG_ENTER("add_plugin");
DBUG_ASSERT(initialized); DBUG_ASSERT(initialized);
...@@ -166,7 +170,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, ...@@ -166,7 +170,7 @@ add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle,
plugin_list[plugin->type]= p; plugin_list[plugin->type]= p;
net_clear_error(&mysql->net); net_clear_error(&mysql->net);
return plugin; DBUG_RETURN(plugin);
err2: err2:
if (plugin->deinit) if (plugin->deinit)
...@@ -177,7 +181,7 @@ err1: ...@@ -177,7 +181,7 @@ err1:
errmsg); errmsg);
if (dlhandle) if (dlhandle)
dlclose(dlhandle); dlclose(dlhandle);
return NULL; DBUG_RETURN(NULL);
} }
/** /**
...@@ -198,10 +202,11 @@ err1: ...@@ -198,10 +202,11 @@ err1:
static void load_env_plugins(MYSQL *mysql) static void load_env_plugins(MYSQL *mysql)
{ {
char *plugs, *free_env, *s= getenv("LIBMYSQL_PLUGINS"); char *plugs, *free_env, *s= getenv("LIBMYSQL_PLUGINS");
DBUG_ENTER("load_env_plugins");
/* no plugins to load */ /* no plugins to load */
if (!s) if (!s)
return; DBUG_VOID_RETURN;
free_env= plugs= my_strdup(s, MYF(MY_WME)); free_env= plugs= my_strdup(s, MYF(MY_WME));
...@@ -213,6 +218,7 @@ static void load_env_plugins(MYSQL *mysql) ...@@ -213,6 +218,7 @@ static void load_env_plugins(MYSQL *mysql)
} while (s); } while (s);
my_free(free_env); my_free(free_env);
DBUG_VOID_RETURN;
} }
/********** extern functions to be used by libmysql *********************/ /********** extern functions to be used by libmysql *********************/
...@@ -229,9 +235,10 @@ int mysql_client_plugin_init() ...@@ -229,9 +235,10 @@ int mysql_client_plugin_init()
{ {
MYSQL mysql; MYSQL mysql;
struct st_mysql_client_plugin **builtin; struct st_mysql_client_plugin **builtin;
DBUG_ENTER("mysql_client_plugin_init");
if (initialized) if (initialized)
return 0; DBUG_RETURN(0);
bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */ bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
...@@ -251,7 +258,7 @@ int mysql_client_plugin_init() ...@@ -251,7 +258,7 @@ int mysql_client_plugin_init()
load_env_plugins(&mysql); load_env_plugins(&mysql);
return 0; DBUG_RETURN(0);
} }
/** /**
...@@ -263,9 +270,10 @@ void mysql_client_plugin_deinit() ...@@ -263,9 +270,10 @@ void mysql_client_plugin_deinit()
{ {
int i; int i;
struct st_client_plugin_int *p; struct st_client_plugin_int *p;
DBUG_ENTER("mysql_client_plugin_deinit");
if (!initialized) if (!initialized)
return; DBUG_VOID_RETURN;
for (i=0; i < MYSQL_CLIENT_MAX_PLUGINS; i++) for (i=0; i < MYSQL_CLIENT_MAX_PLUGINS; i++)
for (p= plugin_list[i]; p; p= p->next) for (p= plugin_list[i]; p; p= p->next)
...@@ -280,6 +288,7 @@ void mysql_client_plugin_deinit() ...@@ -280,6 +288,7 @@ void mysql_client_plugin_deinit()
initialized= 0; initialized= 0;
free_root(&mem_root, MYF(0)); free_root(&mem_root, MYF(0));
pthread_mutex_destroy(&LOCK_load_client_plugin); pthread_mutex_destroy(&LOCK_load_client_plugin);
DBUG_VOID_RETURN;
} }
/************* public facing functions, for client consumption *********/ /************* public facing functions, for client consumption *********/
...@@ -289,8 +298,10 @@ struct st_mysql_client_plugin * ...@@ -289,8 +298,10 @@ struct st_mysql_client_plugin *
mysql_client_register_plugin(MYSQL *mysql, mysql_client_register_plugin(MYSQL *mysql,
struct st_mysql_client_plugin *plugin) struct st_mysql_client_plugin *plugin)
{ {
DBUG_ENTER("mysql_client_register_plugin");
if (is_not_initialized(mysql, plugin->name)) if (is_not_initialized(mysql, plugin->name))
return NULL; DBUG_RETURN(NULL);
pthread_mutex_lock(&LOCK_load_client_plugin); pthread_mutex_lock(&LOCK_load_client_plugin);
...@@ -306,7 +317,7 @@ mysql_client_register_plugin(MYSQL *mysql, ...@@ -306,7 +317,7 @@ mysql_client_register_plugin(MYSQL *mysql,
plugin= add_plugin(mysql, plugin, 0, 0, 0); plugin= add_plugin(mysql, plugin, 0, 0, 0);
pthread_mutex_unlock(&LOCK_load_client_plugin); pthread_mutex_unlock(&LOCK_load_client_plugin);
return plugin; DBUG_RETURN(plugin);
} }
/* see <mysql/client_plugin.h> for a full description */ /* see <mysql/client_plugin.h> for a full description */
...@@ -318,8 +329,8 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, ...@@ -318,8 +329,8 @@ mysql_load_plugin_v(MYSQL *mysql, const char *name, int type,
char dlpath[FN_REFLEN+1]; char dlpath[FN_REFLEN+1];
void *sym, *dlhandle; void *sym, *dlhandle;
struct st_mysql_client_plugin *plugin; struct st_mysql_client_plugin *plugin;
DBUG_ENTER("mysql_load_plugin_v");
DBUG_ENTER ("mysql_load_plugin_v");
DBUG_PRINT ("entry", ("name=%s type=%d int argc=%d", name, type, argc)); DBUG_PRINT ("entry", ("name=%s type=%d int argc=%d", name, type, argc));
if (is_not_initialized(mysql, name)) if (is_not_initialized(mysql, name))
{ {
...@@ -399,10 +410,12 @@ mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...) ...@@ -399,10 +410,12 @@ mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...)
{ {
struct st_mysql_client_plugin *p; struct st_mysql_client_plugin *p;
va_list args; va_list args;
DBUG_ENTER("mysql_load_plugin");
va_start(args, argc); va_start(args, argc);
p= mysql_load_plugin_v(mysql, name, type, argc, args); p= mysql_load_plugin_v(mysql, name, type, argc, args);
va_end(args); va_end(args);
return p; DBUG_RETURN(p);
} }
/* see <mysql/client_plugin.h> for a full description */ /* see <mysql/client_plugin.h> for a full description */
...@@ -410,8 +423,8 @@ struct st_mysql_client_plugin * ...@@ -410,8 +423,8 @@ struct st_mysql_client_plugin *
mysql_client_find_plugin(MYSQL *mysql, const char *name, int type) mysql_client_find_plugin(MYSQL *mysql, const char *name, int type)
{ {
struct st_mysql_client_plugin *p; struct st_mysql_client_plugin *p;
DBUG_ENTER("mysql_client_find_plugin");
DBUG_ENTER ("mysql_client_find_plugin");
DBUG_PRINT ("entry", ("name=%s, type=%d", name, type)); DBUG_PRINT ("entry", ("name=%s, type=%d", name, type));
if (is_not_initialized(mysql, name)) if (is_not_initialized(mysql, name))
DBUG_RETURN (NULL); DBUG_RETURN (NULL);
......
...@@ -1715,13 +1715,17 @@ public: ...@@ -1715,13 +1715,17 @@ public:
int ha_repair(THD* thd, HA_CHECK_OPT* check_opt); int ha_repair(THD* thd, HA_CHECK_OPT* check_opt);
void ha_start_bulk_insert(ha_rows rows) void ha_start_bulk_insert(ha_rows rows)
{ {
DBUG_ENTER("handler::ha_start_bulk_insert");
estimation_rows_to_insert= rows; estimation_rows_to_insert= rows;
start_bulk_insert(rows); start_bulk_insert(rows);
DBUG_VOID_RETURN;
} }
int ha_end_bulk_insert() int ha_end_bulk_insert()
{ {
DBUG_ENTER("handler::ha_end_bulk_insert");
estimation_rows_to_insert= 0; estimation_rows_to_insert= 0;
return end_bulk_insert(); int ret= end_bulk_insert();
DBUG_RETURN(ret);
} }
int ha_bulk_update_row(const uchar *old_data, uchar *new_data, int ha_bulk_update_row(const uchar *old_data, uchar *new_data,
uint *dup_key_found); uint *dup_key_found);
......
...@@ -3827,8 +3827,7 @@ int MYSQL_BIN_LOG::close_purge_index_file() ...@@ -3827,8 +3827,7 @@ int MYSQL_BIN_LOG::close_purge_index_file()
bool MYSQL_BIN_LOG::is_inited_purge_index_file() bool MYSQL_BIN_LOG::is_inited_purge_index_file()
{ {
DBUG_ENTER("MYSQL_BIN_LOG::is_inited_purge_index_file"); return my_b_inited(&purge_index_file);
DBUG_RETURN (my_b_inited(&purge_index_file));
} }
int MYSQL_BIN_LOG::sync_purge_index_file() int MYSQL_BIN_LOG::sync_purge_index_file()
...@@ -3864,13 +3863,12 @@ int MYSQL_BIN_LOG::register_create_index_entry(const char *entry) ...@@ -3864,13 +3863,12 @@ int MYSQL_BIN_LOG::register_create_index_entry(const char *entry)
int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space,
bool need_mutex) bool need_mutex)
{ {
DBUG_ENTER("MYSQL_BIN_LOG:purge_index_entry");
MY_STAT s; MY_STAT s;
int error= 0; int error= 0;
LOG_INFO log_info; LOG_INFO log_info;
LOG_INFO check_log_info; LOG_INFO check_log_info;
DBUG_ENTER("MYSQL_BIN_LOG:purge_index_entry");
DBUG_ASSERT(my_b_inited(&purge_index_file)); DBUG_ASSERT(my_b_inited(&purge_index_file));
if ((error=reinit_io_cache(&purge_index_file, READ_CACHE, 0, 0, 0))) if ((error=reinit_io_cache(&purge_index_file, READ_CACHE, 0, 0, 0)))
......
...@@ -158,14 +158,20 @@ typedef struct st_log_info ...@@ -158,14 +158,20 @@ typedef struct st_log_info
my_off_t pos; my_off_t pos;
bool fatal; // if the purge happens to give us a negative offset bool fatal; // if the purge happens to give us a negative offset
mysql_mutex_t lock; mysql_mutex_t lock;
st_log_info() st_log_info() : index_file_offset(0), index_file_start_offset(0),
: index_file_offset(0), index_file_start_offset(0),
pos(0), fatal(0) pos(0), fatal(0)
{ {
log_file_name[0] = '\0'; DBUG_ENTER("LOG_INFO");
mysql_mutex_init(key_LOG_INFO_lock, &lock, MY_MUTEX_INIT_FAST); log_file_name[0] = '\0';
} mysql_mutex_init(key_LOG_INFO_lock, &lock, MY_MUTEX_INIT_FAST);
~st_log_info() { mysql_mutex_destroy(&lock);} DBUG_VOID_RETURN;
}
~st_log_info()
{
DBUG_ENTER("~LOG_INFO");
mysql_mutex_destroy(&lock);
DBUG_VOID_RETURN;
}
} LOG_INFO; } LOG_INFO;
/* /*
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
table_mapping::table_mapping() table_mapping::table_mapping()
: m_free(0) : m_free(0)
{ {
DBUG_ENTER("table_mapping::table_mapping");
/* /*
No "free_element" function for entries passed here, as the entries are No "free_element" function for entries passed here, as the entries are
allocated in a MEM_ROOT (freed as a whole in the destructor), they cannot allocated in a MEM_ROOT (freed as a whole in the destructor), they cannot
...@@ -46,6 +47,7 @@ table_mapping::table_mapping() ...@@ -46,6 +47,7 @@ table_mapping::table_mapping()
0,0,0); 0,0,0);
/* We don't preallocate any block, this is consistent with m_free=0 above */ /* We don't preallocate any block, this is consistent with m_free=0 above */
init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0); init_alloc_root(&m_mem_root, TABLE_ID_HASH_SIZE*sizeof(entry), 0);
DBUG_VOID_RETURN;
} }
table_mapping::~table_mapping() table_mapping::~table_mapping()
......
...@@ -1723,6 +1723,7 @@ void THD::reset_globals() ...@@ -1723,6 +1723,7 @@ void THD::reset_globals()
void THD::cleanup_after_query() void THD::cleanup_after_query()
{ {
DBUG_ENTER("THD::cleanup_after_query");
/* /*
Reset rand_used so that detection of calls to rand() will save random Reset rand_used so that detection of calls to rand() will save random
seeds if needed by the slave. seeds if needed by the slave.
...@@ -1756,6 +1757,7 @@ void THD::cleanup_after_query() ...@@ -1756,6 +1757,7 @@ void THD::cleanup_after_query()
/* reset table map for multi-table update */ /* reset table map for multi-table update */
table_map_for_update= 0; table_map_for_update= 0;
m_binlog_invoker= FALSE; m_binlog_invoker= FALSE;
DBUG_VOID_RETURN;
} }
...@@ -3035,6 +3037,7 @@ void Statement::restore_backup_statement(Statement *stmt, Statement *backup) ...@@ -3035,6 +3037,7 @@ void Statement::restore_backup_statement(Statement *stmt, Statement *backup)
void THD::end_statement() void THD::end_statement()
{ {
DBUG_ENTER("THD::end_statement");
/* Cleanup SQL processing state to reuse this statement in next query. */ /* Cleanup SQL processing state to reuse this statement in next query. */
lex_end(lex); lex_end(lex);
delete lex->result; delete lex->result;
...@@ -3045,6 +3048,7 @@ void THD::end_statement() ...@@ -3045,6 +3048,7 @@ void THD::end_statement()
Don't free mem_root, as mem_root is freed in the end of dispatch_command Don't free mem_root, as mem_root is freed in the end of dispatch_command
(once for any command). (once for any command).
*/ */
DBUG_VOID_RETURN;
} }
......
...@@ -2811,6 +2811,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl) ...@@ -2811,6 +2811,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl)
void LEX::set_trg_event_type_for_tables() void LEX::set_trg_event_type_for_tables()
{ {
uint8 new_trg_event_map= 0; uint8 new_trg_event_map= 0;
DBUG_ENTER("LEX::set_trg_event_type_for_tables");
/* /*
Some auxiliary operations Some auxiliary operations
...@@ -2930,6 +2931,7 @@ void LEX::set_trg_event_type_for_tables() ...@@ -2930,6 +2931,7 @@ void LEX::set_trg_event_type_for_tables()
tables->trg_event_map= new_trg_event_map; tables->trg_event_map= new_trg_event_map;
tables= tables->next_local; tables= tables->next_local;
} }
DBUG_VOID_RETURN;
} }
......
...@@ -7342,6 +7342,7 @@ bool parse_sql(THD *thd, ...@@ -7342,6 +7342,7 @@ bool parse_sql(THD *thd,
Object_creation_ctx *creation_ctx) Object_creation_ctx *creation_ctx)
{ {
bool ret_value; bool ret_value;
DBUG_ENTER("parse_sql");
DBUG_ASSERT(thd->m_parser_state == NULL); DBUG_ASSERT(thd->m_parser_state == NULL);
DBUG_ASSERT(thd->lex->m_stmt == NULL); DBUG_ASSERT(thd->lex->m_stmt == NULL);
...@@ -7389,7 +7390,7 @@ bool parse_sql(THD *thd, ...@@ -7389,7 +7390,7 @@ bool parse_sql(THD *thd,
ret_value= mysql_parse_status || thd->is_fatal_error; ret_value= mysql_parse_status || thd->is_fatal_error;
MYSQL_QUERY_PARSE_DONE(ret_value); MYSQL_QUERY_PARSE_DONE(ret_value);
return ret_value; DBUG_RETURN(ret_value);
} }
/** /**
......
...@@ -1125,7 +1125,7 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) ...@@ -1125,7 +1125,7 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check)
static void plugin_del(struct st_plugin_int *plugin) static void plugin_del(struct st_plugin_int *plugin)
{ {
DBUG_ENTER("plugin_del(plugin)"); DBUG_ENTER("plugin_del");
mysql_mutex_assert_owner(&LOCK_plugin); mysql_mutex_assert_owner(&LOCK_plugin);
/* Free allocated strings before deleting the plugin. */ /* Free allocated strings before deleting the plugin. */
mysql_rwlock_wrlock(&LOCK_system_variables_hash); mysql_rwlock_wrlock(&LOCK_system_variables_hash);
...@@ -2703,11 +2703,12 @@ static void restore_pluginvar_names(sys_var *first) ...@@ -2703,11 +2703,12 @@ static void restore_pluginvar_names(sys_var *first)
*/ */
static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
{ {
DBUG_ENTER("intern_sys_var_ptr");
DBUG_ASSERT(offset >= 0); DBUG_ASSERT(offset >= 0);
DBUG_ASSERT((uint)offset <= global_system_variables.dynamic_variables_head); DBUG_ASSERT((uint)offset <= global_system_variables.dynamic_variables_head);
if (!thd) if (!thd)
return (uchar*) global_system_variables.dynamic_variables_ptr + offset; DBUG_RETURN((uchar*) global_system_variables.dynamic_variables_ptr + offset);
/* /*
dynamic_variables_head points to the largest valid offset dynamic_variables_head points to the largest valid offset
...@@ -2779,7 +2780,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) ...@@ -2779,7 +2780,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
mysql_rwlock_unlock(&LOCK_system_variables_hash); mysql_rwlock_unlock(&LOCK_system_variables_hash);
} }
return (uchar*)thd->variables.dynamic_variables_ptr + offset; DBUG_RETURN((uchar*)thd->variables.dynamic_variables_ptr + offset);
} }
......
...@@ -1339,6 +1339,7 @@ int ha_myisam::disable_indexes(uint mode) ...@@ -1339,6 +1339,7 @@ int ha_myisam::disable_indexes(uint mode)
int ha_myisam::enable_indexes(uint mode) int ha_myisam::enable_indexes(uint mode)
{ {
int error; int error;
DBUG_ENTER("ha_myisam::enable_indexes");
DBUG_EXECUTE_IF("wait_in_enable_indexes", DBUG_EXECUTE_IF("wait_in_enable_indexes",
debug_wait_for_kill("wait_in_enable_indexes"); ); debug_wait_for_kill("wait_in_enable_indexes"); );
...@@ -1346,7 +1347,7 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1346,7 +1347,7 @@ int ha_myisam::enable_indexes(uint mode)
if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys)) if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys))
{ {
/* All indexes are enabled already. */ /* All indexes are enabled already. */
return 0; DBUG_RETURN(0);
} }
if (mode == HA_KEY_SWITCH_ALL) if (mode == HA_KEY_SWITCH_ALL)
...@@ -1365,7 +1366,7 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1365,7 +1366,7 @@ int ha_myisam::enable_indexes(uint mode)
const char *save_proc_info=thd->proc_info; const char *save_proc_info=thd->proc_info;
if (!&param) if (!&param)
return HA_ADMIN_INTERNAL_ERROR; DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
thd_proc_info(thd, "Creating index"); thd_proc_info(thd, "Creating index");
myisamchk_init(&param); myisamchk_init(&param);
...@@ -1407,7 +1408,7 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1407,7 +1408,7 @@ int ha_myisam::enable_indexes(uint mode)
/* mode not implemented */ /* mode not implemented */
error= HA_ERR_WRONG_COMMAND; error= HA_ERR_WRONG_COMMAND;
} }
return error; DBUG_RETURN(error);
} }
...@@ -1500,6 +1501,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows) ...@@ -1500,6 +1501,7 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
int ha_myisam::end_bulk_insert() int ha_myisam::end_bulk_insert()
{ {
DBUG_ENTER("ha_myisam::end_bulk_insert");
mi_end_bulk_insert(file); mi_end_bulk_insert(file);
int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0); int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0);
if (!err && !file->s->deleting) if (!err && !file->s->deleting)
...@@ -1522,7 +1524,7 @@ int ha_myisam::end_bulk_insert() ...@@ -1522,7 +1524,7 @@ int ha_myisam::end_bulk_insert()
} }
} }
} }
return err; DBUG_RETURN(err);
} }
......
This diff is collapsed.
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