Bug #109633: Display DB (Schema) name the thread is using in the logs during a crash #438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug Reference: https://bugs.mysql.com/bug.php?id=109633
If a thread in MySQL causes a segfault, the signal handler will output information about that thread including the query it was executing but not the DB it is using. Below is an example of this message:
This information does not contain the DB name the thread was using. If the MySQL instance has many DBs with identical table names it can be difficult to determine on which DB the query was executing. As a result identifying a corrupted table or index can not be done easily.
Testing:
Ran a slow query with a sleep in it:
select city,state,sleep(10) from offices;
Found the OS thread ID in
performance_schema.threads
Next sent a SIGSEGV to the thread with
kill
Then captured the output in the error log.