summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-06-20 14:49:25 +0300
committerMichael Widenius <monty@askmonty.org>2013-06-20 14:49:25 +0300
commitc46ce32cfbec0b3c21cb0e5b6bca91bd437130cf (patch)
tree46141a35f7f0b7edc9a1627697a9a301e132eb61
parentf62f4bd563a96ddd78b78d563e4d4cf5ad27aae1 (diff)
downloadmariadb-git-c46ce32cfbec0b3c21cb0e5b6bca91bd437130cf.tar.gz
Fixed memory leaks. alias.test now runs clean with valgrind
-rw-r--r--sql/sp_pcontext.h2
-rw-r--r--sql/sql_array.h4
-rw-r--r--sql/sql_insert.cc3
-rw-r--r--storage/perfschema/pfs_account.cc2
-rw-r--r--storage/perfschema/pfs_digest.cc2
-rw-r--r--storage/perfschema/pfs_host.cc2
-rw-r--r--storage/perfschema/pfs_instr.cc2
-rw-r--r--storage/perfschema/pfs_instr_class.cc2
-rw-r--r--storage/perfschema/pfs_setup_actor.cc2
-rw-r--r--storage/perfschema/pfs_setup_object.cc2
-rw-r--r--storage/perfschema/pfs_user.cc2
11 files changed, 13 insertions, 12 deletions
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index fbf32244665..4d8623108aa 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -238,7 +238,7 @@ public:
/// The class represents parse-time context, which keeps track of declared
/// variables/parameters, conditions, handlers, cursors and labels.
///
-/// sp_context objects are organized in a tree according to the following
+/// sp_pcontext objects are organized in a tree according to the following
/// rules:
/// - one sp_pcontext object corresponds for for each BEGIN..END block;
/// - one sp_pcontext object corresponds for each exception handler;
diff --git a/sql/sql_array.h b/sql/sql_array.h
index baed3687215..71377b91ef9 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -92,6 +92,8 @@ private:
/*
A typesafe wrapper around DYNAMIC_ARRAY
+
+ TODO: Change creator to take a THREAD_SPECIFIC option.
*/
template <class Elem> class Dynamic_array
@@ -106,7 +108,7 @@ public:
void init(uint prealloc=16, uint increment=16)
{
my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment,
- MYF(MY_THREAD_SPECIFIC));
+ MYF(0));
}
/**
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 21bf07cd653..cb506adb495 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -3914,8 +3914,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
}
else
{
- Open_table_context ot_ctx(thd, MYSQL_OPEN_TEMPORARY_ONLY);
- if (open_table(thd, create_table, thd->mem_root, &ot_ctx))
+ if (open_temporary_table(thd, create_table))
{
/*
This shouldn't happen as creation of temporary table should make
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index 9221fc3b991..b91039f6cd7 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -153,7 +153,7 @@ int init_account_hash(void)
{
lf_hash_init(&account_hash, sizeof(PFS_account*), LF_HASH_UNIQUE,
0, 0, account_hash_get_key, &my_charset_bin);
- account_hash.size= account_max;
+ /* account_hash.size= account_max; */
account_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index b2cbd02bd3f..6edcba4c013 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -142,7 +142,7 @@ int init_digest_hash(void)
lf_hash_init(&digest_hash, sizeof(PFS_statements_digest_stat*),
LF_HASH_UNIQUE, 0, 0, digest_hash_get_key,
&my_charset_bin);
- digest_hash.size= digest_max;
+ /* digest_hash.size= digest_max; */
digest_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index 09763b0bd8b..ac6308ff991 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -150,7 +150,7 @@ int init_host_hash(void)
{
lf_hash_init(&host_hash, sizeof(PFS_host*), LF_HASH_UNIQUE,
0, 0, host_hash_get_key, &my_charset_bin);
- host_hash.size= host_max;
+ /* host_hash.size= host_max; */
host_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index dd8f21a262c..7b7340cc713 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -515,7 +515,7 @@ int init_file_hash(void)
{
lf_hash_init(&filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE,
0, 0, filename_hash_get_key, &my_charset_bin);
- filename_hash.size= file_max;
+ /* filename_hash.size= file_max; */
filename_hash_inited= true;
}
DBUG_RETURN(0);
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 05c85104a94..24a06cf494c 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -385,7 +385,7 @@ int init_table_share_hash(void)
{
lf_hash_init(&table_share_hash, sizeof(PFS_table_share*), LF_HASH_UNIQUE,
0, 0, table_share_hash_get_key, &my_charset_bin);
- table_share_hash.size= table_share_max;
+ /* table_share_hash.size= table_share_max; */
table_share_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_setup_actor.cc b/storage/perfschema/pfs_setup_actor.cc
index 943654ce1c9..ff45e4a0971 100644
--- a/storage/perfschema/pfs_setup_actor.cc
+++ b/storage/perfschema/pfs_setup_actor.cc
@@ -104,7 +104,7 @@ int init_setup_actor_hash(void)
{
lf_hash_init(&setup_actor_hash, sizeof(PFS_setup_actor*), LF_HASH_UNIQUE,
0, 0, setup_actor_hash_get_key, &my_charset_bin);
- setup_actor_hash.size= setup_actor_max;
+ /* setup_actor_hash.size= setup_actor_max; */
setup_actor_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index eaded47f60b..535dd53bfc7 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -99,7 +99,7 @@ int init_setup_object_hash(void)
{
lf_hash_init(&setup_object_hash, sizeof(PFS_setup_object*), LF_HASH_UNIQUE,
0, 0, setup_object_hash_get_key, &my_charset_bin);
- setup_object_hash.size= setup_object_max;
+ /* setup_object_hash.size= setup_object_max; */
setup_object_hash_inited= true;
}
return 0;
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index 697b5af2f0d..60d6a2e99f6 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -150,7 +150,7 @@ int init_user_hash(void)
{
lf_hash_init(&user_hash, sizeof(PFS_user*), LF_HASH_UNIQUE,
0, 0, user_hash_get_key, &my_charset_bin);
- user_hash.size= user_max;
+ /* user_hash.size= user_max; */
user_hash_inited= true;
}
return 0;