@@ -29,10 +29,11 @@ impl Session {
2929 self . to_process_info ( & session_ctx)
3030 }
3131
32- fn to_process_info ( self : & Arc < Self > , status : & SessionContext ) -> ProcessInfo {
32+ fn to_process_info ( self : & Arc < Self > , session_ctx : & SessionContext ) -> ProcessInfo {
3333 let mut memory_usage = 0 ;
3434
35- if let Some ( shared) = status. get_query_context_shared ( ) {
35+ let shared_query_context = & session_ctx. get_query_context_shared ( ) ;
36+ if let Some ( shared) = shared_query_context {
3637 if let Ok ( runtime) = shared. try_get_runtime ( ) {
3738 let mem_stat = runtime. get_tracker ( ) ;
3839 memory_usage = mem_stat. get_memory_usage ( ) ;
@@ -42,17 +43,20 @@ impl Session {
4243 ProcessInfo {
4344 id : self . id . clone ( ) ,
4445 typ : self . get_type ( ) . to_string ( ) ,
45- state : self . process_state ( status ) ,
46- database : status . get_current_database ( ) ,
47- user : status . get_current_user ( ) ,
46+ state : self . process_state ( session_ctx ) ,
47+ database : session_ctx . get_current_database ( ) ,
48+ user : session_ctx . get_current_user ( ) ,
4849 settings : self . get_settings ( ) ,
49- client_address : status . get_client_host ( ) ,
50- session_extra_info : self . process_extra_info ( status ) ,
50+ client_address : session_ctx . get_client_host ( ) ,
51+ session_extra_info : self . process_extra_info ( session_ctx ) ,
5152 memory_usage,
52- data_metrics : Self :: query_data_metrics ( status ) ,
53- scan_progress_value : Self :: query_scan_progress_value ( status ) ,
53+ data_metrics : Self :: query_data_metrics ( session_ctx ) ,
54+ scan_progress_value : Self :: query_scan_progress_value ( session_ctx ) ,
5455 mysql_connection_id : self . mysql_connection_id ,
55- created_time : Self :: query_created_time ( status) ,
56+ created_time : Self :: query_created_time ( session_ctx) ,
57+ status_info : shared_query_context
58+ . as_ref ( )
59+ . map ( |qry_ctx| qry_ctx. get_status_info ( ) ) ,
5660 }
5761 }
5862
0 commit comments