Skip to content

Commit b407406

Browse files
committed
MDEV-26657 : Initialize some fields in create_background_thd()
Avoid reading uninitialized memory by thd_get_error_context_description(). Note, that THD::real_id can't be initialized at this stage, so it will be zeroed.
1 parent 699de65 commit b407406

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sql/sql_class.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4922,6 +4922,9 @@ MYSQL_THD create_background_thd()
49224922
thd->set_command(COM_DAEMON);
49234923
thd->system_thread= SYSTEM_THREAD_GENERIC;
49244924
thd->security_ctx->host_or_ip= "";
4925+
thd->real_id= 0;
4926+
thd->thread_id= 0;
4927+
thd->query_id= 0;
49254928
return thd;
49264929
}
49274930

0 commit comments

Comments
 (0)