Skip to content

Commit c8fb911

Browse files
committed
fix main.lock_kill crashes in --ps --embed
when checking whether thd wasn't killed before this emb_advanced_command(), take into account that it could've been killed before the *previous* emb_advanced_command(). That is, the previous one has already set thd to NULL and this one only wanted a COM_STMT_RESET after a failure.
1 parent 771f3cf commit c8fb911

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libmysqld/lib_sql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
115115
NET *net= &mysql->net;
116116
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
117117

118-
if (thd->killed != NOT_KILLED)
118+
if (thd && thd->killed != NOT_KILLED)
119119
{
120120
if (thd->killed < KILL_CONNECTION)
121121
thd->killed= NOT_KILLED;

0 commit comments

Comments
 (0)