v.20.11Improvement

Add current_database to system.query_thread_log

Add current_database into system.query_thread_log. #16558 (Azat Khuzhin).
Added the current_database column to the system.query_thread_log table.

Why it matters

This feature allows users to see which database was active during the execution of each query thread, providing better context and easier debugging or auditing of queries across multiple databases.

How to use it

Users can query the system.query_thread_log system table and include the current_database column in their SELECT statements to identify the active database for each query thread.