1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed compiler and valgrind warnings

Added missing DBUG_xxx_RETURN statements
Fixed some usage of not initialized variables (as found by valgrind)
Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called.
This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names()
This will allow Tomas to continue with his work to use namelocks to syncronize things.

Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
This commit is contained in:
monty@mysql.com
2006-03-29 14:27:36 +03:00
parent 8cb3cf2382
commit 1994ed49ec
44 changed files with 256 additions and 114 deletions

View File

@ -565,6 +565,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
String built_query;
DBUG_ENTER("mysql_rm_table_part2");
LINT_INIT(alias);
LINT_INIT(path_length);
safe_mutex_assert_owner(&LOCK_open);
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
built_query.set_charset(system_charset_info);
@ -614,7 +618,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
*/
if (thd->current_stmt_binlog_row_based && !dont_log_query)
{
++non_temp_tables_count;
non_temp_tables_count++;
/*
Don't write the database name if it is the current one (or if
thd->db is NULL).
@ -634,11 +638,18 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
table_type= table->db_type;
if (!drop_temporary)
{
TABLE *locked_table;
abort_locked_tables(thd, db, table->table_name);
remove_table_from_cache(thd, db, table->table_name,
RTFC_WAIT_OTHER_THREAD_FLAG |
RTFC_CHECK_KILLED_FLAG);
drop_locked_tables(thd, db, table->table_name);
/*
If the table was used in lock tables, remember it so that
unlock_table_names can free it
*/
if ((locked_table= drop_locked_tables(thd, db, table->table_name)))
table->table= locked_table;
if (thd->killed)
{
thd->no_warnings_for_error= 0;
@ -649,8 +660,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
path_length= build_table_filename(path, sizeof(path),
db, alias, reg_ext);
}
if (table_type == NULL &&
(drop_temporary ||
if (drop_temporary ||
(table_type == NULL &&
(access(path, F_OK) &&
ha_create_table_from_engine(thd, db, alias)) ||
(!drop_view &&
@ -3962,6 +3973,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
bool committed= 0;
DBUG_ENTER("mysql_alter_table");
LINT_INIT(index_add_count);
LINT_INIT(index_drop_count);
LINT_INIT(index_add_buffer);
LINT_INIT(index_drop_buffer);
thd->proc_info="init";
table_name=table_list->table_name;
alias= (lower_case_table_names == 2) ? table_list->alias : table_name;