summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-04-17 22:33:33 +0300
committerMichael Widenius <monty@askmonty.org>2013-04-17 22:33:33 +0300
commit8e526985800678de20356cece1183f49f69c26f9 (patch)
tree2213bcbcd50e92689e28be978d378cea33cfd497
parent43fe53acc225a2cea07188d142c1c0f8364cc43b (diff)
downloadmariadb-git-8e526985800678de20356cece1183f49f69c26f9.tar.gz
Fixed compiler warnings and a not critical memory leak
sql/keycaches.cc: Added free_all_rpl_filters() to be able to free all filters at cleanup sql/keycaches.h: Added prototype sql/rpl_rli.cc: Fixed compiler warning sql/slave.cc: Free all rpl_filters at cleanup sql/sp.cc: Fixed compiler warning when not all struct elements was initialized sql/sql_acl.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_events_waits.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_events_waits_summary.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_ews_global_by_event_name.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_file_instances.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_file_summary.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_performance_timers.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_setup_consumers.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_setup_instruments.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_setup_timers.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_sync_instances.cc: Fixed compiler warning when not all struct elements was initialized storage/perfschema/table_threads.cc: Fixed compiler warning when not all struct elements was initialized storage/xtradb/os/os0file.c: Fixed compiler warning when not all struct elements was initialized
-rw-r--r--sql/keycaches.cc4
-rw-r--r--sql/keycaches.h1
-rw-r--r--sql/rpl_rli.cc5
-rw-r--r--sql/slave.cc1
-rw-r--r--sql/sp.cc2
-rw-r--r--sql/sql_acl.cc2
-rw-r--r--storage/perfschema/table_events_waits.cc2
-rw-r--r--storage/perfschema/table_events_waits_summary.cc4
-rw-r--r--storage/perfschema/table_ews_global_by_event_name.cc2
-rw-r--r--storage/perfschema/table_file_instances.cc2
-rw-r--r--storage/perfschema/table_file_summary.cc4
-rw-r--r--storage/perfschema/table_performance_timers.cc2
-rw-r--r--storage/perfschema/table_setup_consumers.cc2
-rw-r--r--storage/perfschema/table_setup_instruments.cc2
-rw-r--r--storage/perfschema/table_setup_timers.cc2
-rw-r--r--storage/perfschema/table_sync_instances.cc6
-rw-r--r--storage/perfschema/table_threads.cc2
-rw-r--r--storage/xtradb/os/os0file.c3
18 files changed, 27 insertions, 21 deletions
diff --git a/sql/keycaches.cc b/sql/keycaches.cc
index 9e4b943dc83..120aa7e1029 100644
--- a/sql/keycaches.cc
+++ b/sql/keycaches.cc
@@ -225,3 +225,7 @@ void free_rpl_filter(const char *name, Rpl_filter *filter)
delete filter;
}
+void free_all_rpl_filters()
+{
+ rpl_filters.delete_elements((void (*)(const char*, uchar*)) free_rpl_filter);
+}
diff --git a/sql/keycaches.h b/sql/keycaches.h
index 2d52cb28973..32537339e2e 100644
--- a/sql/keycaches.h
+++ b/sql/keycaches.h
@@ -53,5 +53,6 @@ Rpl_filter *create_rpl_filter(const char *name, uint length);
Rpl_filter *get_rpl_filter(LEX_STRING *filter_name);
Rpl_filter *get_or_create_rpl_filter(const char *name, uint length);
void free_rpl_filter(const char *name, Rpl_filter *filter);
+void free_all_rpl_filters(void);
#endif /* KEYCACHES_INCLUDED */
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 11c6e54c8f8..7733354b106 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -48,7 +48,8 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
info_fd(-1), cur_log_fd(-1), relay_log(&sync_relaylog_period),
sync_counter(0), is_relay_log_recovery(is_slave_recovery),
- save_temporary_tables(0), cur_log_old_open_count(0), group_relay_log_pos(0),
+ save_temporary_tables(0), mi(0),
+ cur_log_old_open_count(0), group_relay_log_pos(0),
event_relay_log_pos(0),
#if HAVE_valgrind
is_fake(FALSE),
@@ -61,7 +62,7 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
gtid_sub_id(0), tables_to_lock(0), tables_to_lock_count(0),
last_event_start_time(0), deferred_events(NULL),m_flags(0),
row_stmt_start_timestamp(0), long_find_row_note_printed(false),
- m_annotate_event(0), mi(0)
+ m_annotate_event(0)
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
diff --git a/sql/slave.cc b/sql/slave.cc
index 2e436d5e8b4..0a260272929 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -870,6 +870,7 @@ void end_slave()
master_info_index= 0;
active_mi= 0;
mysql_mutex_unlock(&LOCK_active_mi);
+ free_all_rpl_filters();
DBUG_VOID_RETURN;
}
diff --git a/sql/sp.cc b/sql/sp.cc
index b80fa968483..2aec9d19869 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -168,7 +168,7 @@ TABLE_FIELD_TYPE proc_table_fields[MYSQL_PROC_FIELD_COUNT] =
};
static const TABLE_FIELD_DEF
- proc_table_def= {MYSQL_PROC_FIELD_COUNT, proc_table_fields};
+proc_table_def= {MYSQL_PROC_FIELD_COUNT, proc_table_fields, 0, (uint*) 0 };
/*************************************************************************/
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 7810bdb16e2..69290a64a29 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -171,7 +171,7 @@ TABLE_FIELD_TYPE mysql_db_table_fields[MYSQL_DB_FIELD_COUNT] = {
};
const TABLE_FIELD_DEF
- mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields};
+mysql_db_table_def= {MYSQL_DB_FIELD_COUNT, mysql_db_table_fields, 0, (uint*) 0 };
static LEX_STRING native_password_plugin_name= {
C_STRING_WITH_LEN("mysql_native_password")
diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc
index 8408cc55975..864cecd32b5 100644
--- a/storage/perfschema/table_events_waits.cc
+++ b/storage/perfschema/table_events_waits.cc
@@ -113,7 +113,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_events_waits_current::m_field_def=
-{ 16, field_types };
+{ 16, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_events_waits_current::m_share=
diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc
index 05f280f8521..15fe0d5202b 100644
--- a/storage/perfschema/table_events_waits_summary.cc
+++ b/storage/perfschema/table_events_waits_summary.cc
@@ -69,7 +69,7 @@ static const TABLE_FIELD_TYPE ews_by_thread_by_event_name_field_types[]=
TABLE_FIELD_DEF
table_events_waits_summary_by_thread_by_event_name::m_field_def=
-{ 7, ews_by_thread_by_event_name_field_types };
+{ 7, ews_by_thread_by_event_name_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_events_waits_summary_by_thread_by_event_name::m_share=
@@ -381,7 +381,7 @@ static const TABLE_FIELD_TYPE ews_by_instance_field_types[]=
TABLE_FIELD_DEF
table_events_waits_summary_by_instance::m_field_def=
-{ 7, ews_by_instance_field_types };
+{ 7, ews_by_instance_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_events_waits_summary_by_instance::m_share=
diff --git a/storage/perfschema/table_ews_global_by_event_name.cc b/storage/perfschema/table_ews_global_by_event_name.cc
index 3177584231d..a880a96be4c 100644
--- a/storage/perfschema/table_ews_global_by_event_name.cc
+++ b/storage/perfschema/table_ews_global_by_event_name.cc
@@ -64,7 +64,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_ews_global_by_event_name::m_field_def=
-{ 6, field_types };
+{ 6, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_ews_global_by_event_name::m_share=
diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc
index 9ae732a0e1c..2c116ce1eb2 100644
--- a/storage/perfschema/table_file_instances.cc
+++ b/storage/perfschema/table_file_instances.cc
@@ -49,7 +49,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_file_instances::m_field_def=
-{ 3, field_types };
+{ 3, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_file_instances::m_share=
diff --git a/storage/perfschema/table_file_summary.cc b/storage/perfschema/table_file_summary.cc
index a954db7ef4e..104fa0fbd36 100644
--- a/storage/perfschema/table_file_summary.cc
+++ b/storage/perfschema/table_file_summary.cc
@@ -59,7 +59,7 @@ static const TABLE_FIELD_TYPE fs_by_event_name_field_types[]=
TABLE_FIELD_DEF
table_file_summary_by_event_name::m_field_def=
-{ 5, fs_by_event_name_field_types };
+{ 5, fs_by_event_name_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_file_summary_by_event_name::m_share=
@@ -222,7 +222,7 @@ static const TABLE_FIELD_TYPE fs_by_instance_field_types[]=
TABLE_FIELD_DEF
table_file_summary_by_instance::m_field_def=
-{ 6, fs_by_instance_field_types };
+{ 6, fs_by_instance_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_file_summary_by_instance::m_share=
diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc
index acd379bc57b..3c5d5a09772 100644
--- a/storage/perfschema/table_performance_timers.cc
+++ b/storage/perfschema/table_performance_timers.cc
@@ -53,7 +53,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_performance_timers::m_field_def=
-{ 4, field_types };
+{ 4, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_performance_timers::m_share=
diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc
index 601e0483b14..aa86b094c08 100644
--- a/storage/perfschema/table_setup_consumers.cc
+++ b/storage/perfschema/table_setup_consumers.cc
@@ -79,7 +79,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_setup_consumers::m_field_def=
-{ 2, field_types };
+{ 2, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_setup_consumers::m_share=
diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc
index 480c0dbc13f..d3f39635bed 100644
--- a/storage/perfschema/table_setup_instruments.cc
+++ b/storage/perfschema/table_setup_instruments.cc
@@ -49,7 +49,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_setup_instruments::m_field_def=
-{ 3, field_types };
+{ 3, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_setup_instruments::m_share=
diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc
index f8b1bfa4fe2..0bba71c7e2f 100644
--- a/storage/perfschema/table_setup_timers.cc
+++ b/storage/perfschema/table_setup_timers.cc
@@ -52,7 +52,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_setup_timers::m_field_def=
-{ 2, field_types };
+{ 2, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_setup_timers::m_share=
diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc
index f2bd9fa1a28..584817d695d 100644
--- a/storage/perfschema/table_sync_instances.cc
+++ b/storage/perfschema/table_sync_instances.cc
@@ -50,7 +50,7 @@ static const TABLE_FIELD_TYPE mutex_field_types[]=
TABLE_FIELD_DEF
table_mutex_instances::m_field_def=
-{ 3, mutex_field_types };
+{ 3, mutex_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_mutex_instances::m_share=
@@ -218,7 +218,7 @@ static const TABLE_FIELD_TYPE rwlock_field_types[]=
TABLE_FIELD_DEF
table_rwlock_instances::m_field_def=
-{ 4, rwlock_field_types };
+{ 4, rwlock_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_rwlock_instances::m_share=
@@ -383,7 +383,7 @@ static const TABLE_FIELD_TYPE cond_field_types[]=
TABLE_FIELD_DEF
table_cond_instances::m_field_def=
-{ 2, cond_field_types };
+{ 2, cond_field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_cond_instances::m_share=
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index 541ba860386..bbbfa28fa0f 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -47,7 +47,7 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF
table_threads::m_field_def=
-{ 3, field_types };
+{ 3, field_types, 0, (uint*) 0 };
PFS_engine_table_share
table_threads::m_share=
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c
index 8f1b3e46bb2..8f7f8216782 100644
--- a/storage/xtradb/os/os0file.c
+++ b/storage/xtradb/os/os0file.c
@@ -1462,7 +1462,6 @@ os_file_set_nocache(
#endif
static int os_file_set_atomic_writes(os_file_t file, const char *name)
{
- static int first_time = 1;
int atomic_option = 1;
int ret = ioctl (file, DFS_IOCTL_ATOMIC_WRITE_SET, &atomic_option);
@@ -2138,7 +2137,7 @@ os_file_set_size(
"InnoDB: Error: preallocating data for"
" file %s failed at\n"
"InnoDB: offset 0 size %lld %lld. Operating system"
- " error number %llu.\n"
+ " error number %d.\n"
"InnoDB: Check that the disk is not full"
" or a disk quota exceeded.\n"
"InnoDB: Some operating system error numbers"