Skip to content

Commit 9f9eb68

Browse files
committed
MDEV-10098 main.create_delayed fails with ps-protocol: assertion `global_status_var.global_memory_used >= 0' failed
Remove the assert. We cannot verify that global_memory_used value is valid (>=0) because some of updates are cached in individual THD's (e.g. THD1 can have +300 cached, while the other THD2 can have -300 cached. If the second THD exists before the first one, global_memory_used will be -300 temporarily). Instead add the assert just before the exit, when all THDs been already destroyed.
1 parent e65703c commit 9f9eb68

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

sql/mysqld.cc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,7 @@ static void mysqld_exit(int exit_code)
21412141
shutdown_performance_schema(); // we do it as late as possible
21422142
#endif
21432143
set_malloc_size_cb(NULL);
2144+
DBUG_ASSERT(global_status_var.global_memory_used == 0);
21442145
cleanup_tls();
21452146
DBUG_LEAVE;
21462147
if (opt_endinfo && global_status_var.global_memory_used)
@@ -4109,14 +4110,6 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
41094110
else
41104111
{
41114112
update_global_memory_status(size);
4112-
#ifndef EMBEDDED_LIBRARY
4113-
/*
4114-
Check if we have missed some mallocs. THis can't be done for embedded
4115-
server as the main code may have done calls to malloc before starting
4116-
the embedded library.
4117-
*/
4118-
DBUG_ASSERT(global_status_var.global_memory_used >= 0);
4119-
#endif
41204113
}
41214114
}
41224115
}

0 commit comments

Comments
 (0)