summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-10-17 19:11:42 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-10-17 19:11:42 +0300
commitd88c136b9fb409cbf6421635a6175329e7182cd7 (patch)
tree7f713ddfece5aeefd47025e1beca2fc0a541248b /sql/mysqld.cc
parent13e217b8c1da39b1246fe82203a4c8897d4c9e8d (diff)
parent2fa4ed031ce6cc6370671058ccc3d119b8cb3d91 (diff)
downloadmariadb-git-d88c136b9fb409cbf6421635a6175329e7182cd7.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 76455177a6e..80172d6a070 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3911,14 +3911,16 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
{
THD *thd= current_thd;
- if (is_thread_specific) /* If thread specific memory */
- {
- /*
- When thread specfic is set, both mysqld_server_initialized and thd
- must be set
- */
- DBUG_ASSERT(mysqld_server_initialized && thd);
+ /*
+ When thread specific is set, both mysqld_server_initialized and thd
+ must be set, and we check that with DBUG_ASSERT.
+ However, do not crash, if current_thd is NULL, in release version.
+ */
+ DBUG_ASSERT(!is_thread_specific || (mysqld_server_initialized && thd));
+
+ if (is_thread_specific && likely(thd)) /* If thread specific memory */
+ {
DBUG_PRINT("info", ("thd memory_used: %lld size: %lld",
(longlong) thd->status_var.local_memory_used,
size));