Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mysql-test/suite/perfschema/r/dml_threads.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ update performance_schema.threads
set thread_id=12;
ERROR HY000: Invalid performance_schema usage
update performance_schema.threads
set thread_id=12 where PROCESSLIST_ID=connection_id();
set thread_id=100000 where PROCESSLIST_ID=connection_id();
ERROR HY000: Invalid performance_schema usage
update performance_schema.threads
set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/perfschema/t/dml_threads.test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ update performance_schema.threads

--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.threads
set thread_id=12 where PROCESSLIST_ID=connection_id();
set thread_id=100000 where PROCESSLIST_ID=connection_id();

@svoj svoj Jul 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100000 might be too close to what we could reasonably get using mtr. I'd use some other value:

  • 0 - IIUC PFS still may allocate this value to some thread at early startup
  • BIGINT_MAX - almost impossible to hit in current implementation
  • connection_id() - N - can be affected by lingering connections
  • connection_id() + N - sounds reliable assuming the default connection is the most recent one.

UPD: argh, connection_id() is from a different namespace, but you got the idea.


update performance_schema.threads
set instrumented= 'NO' where PROCESSLIST_ID=connection_id();
Expand Down