mirror of
https://github.com/MariaDB/server.git
synced 2026-05-01 20:55:32 +02:00
MDEV-24757 : fix potential null pointer dereference in I_S.thread_pool_queues
With the fix, new connection without THDs will now show NULL in thread_pool_queues.CONNECTION_ID.
This commit is contained in:
parent
e2c571ad84
commit
b5dab19efa
2 changed files with 4 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ Field Type Null Key Default Extra
|
|||
GROUP_ID int(6) NO 0
|
||||
POSITION int(6) NO 0
|
||||
PRIORITY int(1) NO 0
|
||||
CONNECTION_ID bigint(19) unsigned NO 0
|
||||
CONNECTION_ID bigint(19) unsigned YES NULL
|
||||
QUEUEING_TIME_MICROSECONDS bigint(19) NO 0
|
||||
DESC INFORMATION_SCHEMA.THREAD_POOL_STATS;
|
||||
Field Type Null Key Default Extra
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ static ST_FIELD_INFO queues_field_info[] =
|
|||
Column("GROUP_ID", SLong(6), NOT_NULL),
|
||||
Column("POSITION", SLong(6), NOT_NULL),
|
||||
Column("PRIORITY", SLong(1), NOT_NULL),
|
||||
Column("CONNECTION_ID", ULonglong(19), NOT_NULL),
|
||||
Column("CONNECTION_ID", ULonglong(19), NULLABLE),
|
||||
Column("QUEUEING_TIME_MICROSECONDS", SLonglong(19), NOT_NULL),
|
||||
CEnd()
|
||||
};
|
||||
|
|
@ -130,7 +130,8 @@ static int queues_fill_table(THD* thd, TABLE_LIST* tables, COND*)
|
|||
/* PRIORITY */
|
||||
table->field[2]->store(prio, true);
|
||||
/* CONNECTION_ID */
|
||||
table->field[3]->store(c->thd->thread_id, true);
|
||||
if (c->thd)
|
||||
table->field[3]->store(c->thd->thread_id, true);
|
||||
/* QUEUEING_TIME */
|
||||
table->field[4]->store(now - c->enqueue_time, true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue