Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f62f4bd5
Commit
f62f4bd5
authored
Jun 19, 2013
by
Michael Widenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some memory leaks
Disabled some asserts that we can't yet have enabled
parent
dfcc502a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
14 deletions
+29
-14
mysys/safemalloc.c
mysys/safemalloc.c
+2
-2
sql/mysqld.cc
sql/mysqld.cc
+3
-1
sql/sp_head.cc
sql/sp_head.cc
+8
-1
sql/sql_base.cc
sql/sql_base.cc
+1
-0
sql/sql_class.cc
sql/sql_class.cc
+3
-1
sql/sql_error.cc
sql/sql_error.cc
+4
-2
sql/sql_error.h
sql/sql_error.h
+2
-1
sql/sql_get_diagnostics.cc
sql/sql_get_diagnostics.cc
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+2
-2
sql/sys_vars.cc
sql/sys_vars.cc
+1
-1
storage/perfschema/pfs_instr.cc
storage/perfschema/pfs_instr.cc
+1
-1
storage/perfschema/pfs_setup_object.cc
storage/perfschema/pfs_setup_object.cc
+1
-1
No files found.
mysys/safemalloc.c
View file @
f62f4bd5
...
...
@@ -373,8 +373,8 @@ void sf_report_leaked_memory(my_thread_id id)
{
my_thread_id
tid
=
irem
->
thread_id
&&
irem
->
flags
&
MY_THREAD_SPECIFIC
?
irem
->
thread_id
:
0
;
fprintf
(
stderr
,
"Warning: %4lu bytes lost, allocated by T@%lu at "
,
(
ulong
)
irem
->
datasize
,
tid
);
fprintf
(
stderr
,
"Warning: %4lu bytes lost
at %p
, allocated by T@%lu at "
,
(
ulong
)
irem
->
datasize
,
(
char
*
)
(
irem
+
1
),
tid
);
print_stack
(
irem
->
frame
);
total
+=
irem
->
datasize
;
}
...
...
sql/mysqld.cc
View file @
f62f4bd5
...
...
@@ -3624,13 +3624,15 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
However, this should never happen, so better to assert and
fix this.
*/
#ifdef ENABLE_BEFORE_END_OF_MERGE_QQ
DBUG_ASSERT
(
thd
);
#endif
if
(
thd
)
{
DBUG_PRINT
(
"info"
,
(
"memory_used: %lld size: %lld"
,
(
longlong
)
thd
->
status_var
.
memory_used
,
size
));
thd
->
status_var
.
memory_used
+=
size
;
#if
ndef ENABLE_BEFORE_END_OF_MERGE
#if
def ENABLE_BEFORE_END_OF_MERGE_QQ
DBUG_ASSERT
((
longlong
)
thd
->
status_var
.
memory_used
>=
0
);
#endif
}
...
...
sql/sp_head.cc
View file @
f62f4bd5
...
...
@@ -1969,8 +1969,9 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if
(
!
octx
)
{
/* Create a temporary old context. */
if
(
!
(
octx
=
sp_rcontext
::
create
(
thd
,
m_pcont
,
NULL
)))
{
delete
octx
;
/* Delete octx if it was init() that failed. */
DBUG_PRINT
(
"error"
,
(
"Could not create octx"
));
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -2034,6 +2035,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if
(
!
null_item
||
nctx
->
set_variable
(
thd
,
i
,
&
tmp_item
))
{
DBUG_PRINT
(
"error"
,
(
"set variable failed"
));
err_status
=
TRUE
;
break
;
}
...
...
@@ -2042,6 +2044,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
{
if
(
nctx
->
set_variable
(
thd
,
i
,
it_args
.
ref
()))
{
DBUG_PRINT
(
"error"
,
(
"set variable 2 failed"
));
err_status
=
TRUE
;
break
;
}
...
...
@@ -2098,7 +2101,10 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
#endif
if
(
!
err_status
)
{
err_status
=
execute
(
thd
,
TRUE
);
DBUG_PRINT
(
"info"
,
(
"execute returned %d"
,
(
int
)
err_status
));
}
if
(
save_log_general
)
thd
->
variables
.
option_bits
&=
~
OPTION_LOG_OFF
;
...
...
@@ -2138,6 +2144,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if
(
srp
->
set_value
(
thd
,
octx
,
nctx
->
get_item_addr
(
i
)))
{
DBUG_PRINT
(
"error"
,
(
"set value failed"
));
err_status
=
TRUE
;
break
;
}
...
...
sql/sql_base.cc
View file @
f62f4bd5
...
...
@@ -440,6 +440,7 @@ static void table_def_free_entry(TABLE_SHARE *share)
bool
table_def_init
(
void
)
{
table_def_inited
=
1
;
#ifdef HAVE_PSI_INTERFACE
init_tdc_psi_keys
();
#endif
...
...
sql/sql_class.cc
View file @
f62f4bd5
...
...
@@ -857,7 +857,7 @@ THD::THD()
#if defined(ENABLED_DEBUG_SYNC)
debug_sync_control
(
0
),
#endif
/* defined(ENABLED_DEBUG_SYNC) */
main_da
(
0
,
false
),
main_da
(
0
,
false
,
false
),
m_stmt_da
(
&
main_da
)
{
ulong
tmp
;
...
...
@@ -1561,7 +1561,9 @@ THD::~THD()
{
DBUG_PRINT
(
"error"
,
(
"memory_used: %lld"
,
status_var
.
memory_used
));
SAFEMALLOC_REPORT_MEMORY
(
my_thread_dbug_id
());
#ifdef ENABLE_BEFORE_END_OF_MERGE_QQ
DBUG_ASSERT
(
status_var
.
memory_used
==
0
);
// Ensure everything is freed
#endif
}
set_current_thd
(
orig_thd
);
...
...
sql/sql_error.cc
View file @
f62f4bd5
...
...
@@ -327,8 +327,9 @@ Diagnostics_area::Diagnostics_area(bool initialize)
}
Diagnostics_area
::
Diagnostics_area
(
ulonglong
warning_info_id
,
bool
allow_unlimited_warnings
)
:
m_main_wi
(
warning_info_id
,
allow_unlimited_warnings
,
true
)
bool
allow_unlimited_warnings
,
bool
initialize
)
:
m_main_wi
(
warning_info_id
,
allow_unlimited_warnings
,
initialize
)
{
push_warning_info
(
&
m_main_wi
);
...
...
@@ -527,6 +528,7 @@ Warning_info::Warning_info(ulonglong warn_id_arg,
void
Warning_info
::
init
()
{
/* Initialize sub structures */
DBUG_ASSERT
(
initialized
==
0
);
init_sql_alloc
(
&
m_warn_root
,
WARN_ALLOC_BLOCK_SIZE
,
WARN_ALLOC_PREALLOC_SIZE
,
MYF
(
MY_THREAD_SPECIFIC
));
initialized
=
1
;
...
...
sql/sql_error.h
View file @
f62f4bd5
...
...
@@ -713,7 +713,8 @@ class Diagnostics_area
}
Diagnostics_area
(
bool
initialize
);
Diagnostics_area
(
ulonglong
warning_info_id
,
bool
allow_unlimited_warnings
);
Diagnostics_area
(
ulonglong
warning_info_id
,
bool
allow_unlimited_warnings
,
bool
initialize
);
void
init
()
{
m_main_wi
.
init
()
;
}
void
free_memory
()
{
m_main_wi
.
free_memory
()
;
}
...
...
sql/sql_get_diagnostics.cc
View file @
f62f4bd5
...
...
@@ -43,7 +43,7 @@ bool
Sql_cmd_get_diagnostics
::
execute
(
THD
*
thd
)
{
bool
rv
;
Diagnostics_area
new_stmt_da
(
thd
->
query_id
,
false
);
Diagnostics_area
new_stmt_da
(
thd
->
query_id
,
false
,
true
);
Diagnostics_area
*
save_stmt_da
=
thd
->
get_stmt_da
();
DBUG_ENTER
(
"Sql_cmd_get_diagnostics::execute"
);
...
...
sql/sql_prepare.cc
View file @
f62f4bd5
...
...
@@ -2993,7 +2993,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
param
=
stmt
->
param_array
[
param_number
];
Diagnostics_area
new_stmt_da
(
thd
->
query_id
,
false
);
Diagnostics_area
new_stmt_da
(
thd
->
query_id
,
false
,
true
);
Diagnostics_area
*
save_stmt_da
=
thd
->
get_stmt_da
();
thd
->
set_stmt_da
(
&
new_stmt_da
);
...
...
@@ -4066,7 +4066,7 @@ Ed_result_set::Ed_result_set(List<Ed_row> *rows_arg,
*/
Ed_connection
::
Ed_connection
(
THD
*
thd
)
:
m_diagnostics_area
(
thd
->
query_id
,
false
),
:
m_diagnostics_area
(
thd
->
query_id
,
false
,
true
),
m_thd
(
thd
),
m_rsets
(
0
),
m_current_rset
(
0
)
...
...
sql/sys_vars.cc
View file @
f62f4bd5
...
...
@@ -72,7 +72,7 @@
static
Sys_var_mybool
Sys_pfs_enabled
(
"performance_schema"
,
"Enable the performance schema."
,
READ_ONLY
GLOBAL_VAR
(
pfs_param
.
m_enabled
),
PARSED_EARLY
READ_ONLY
GLOBAL_VAR
(
pfs_param
.
m_enabled
),
CMD_LINE
(
OPT_ARG
),
DEFAULT
(
TRUE
));
static
Sys_var_long
Sys_pfs_events_waits_history_long_size
(
...
...
storage/perfschema/pfs_instr.cc
View file @
f62f4bd5
...
...
@@ -797,7 +797,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity)
*/
void
destroy_cond
(
PFS_cond
*
pfs
)
{
DBUG_ENTER
(
"destroy_
threa
d"
);
DBUG_ENTER
(
"destroy_
con
d"
);
DBUG_ASSERT
(
pfs
!=
NULL
);
PFS_cond_class
*
klass
=
pfs
->
m_class
;
...
...
storage/perfschema/pfs_setup_object.cc
View file @
f62f4bd5
...
...
@@ -110,8 +110,8 @@ void cleanup_setup_object_hash(void)
{
if
(
setup_object_hash_inited
)
{
lf_hash_destroy
(
&
setup_object_hash
);
setup_object_hash_inited
=
false
;
lf_hash_destroy
(
&
setup_object_hash
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment