@@ -37,13 +37,13 @@ bool PFS_system_variable_cache::init_show_var_array(enum_var_type scope)
37
37
{
38
38
DBUG_ASSERT (!m_initialized);
39
39
m_query_scope= scope;
40
-
40
+
41
41
mysql_rwlock_rdlock (&LOCK_system_variables_hash);
42
42
DEBUG_SYNC (m_current_thd, " acquired_LOCK_system_variables_hash" );
43
43
44
44
/* Record the system variable hash version to detect subsequent changes. */
45
45
m_version= get_system_variable_hash_version ();
46
-
46
+
47
47
/* Build the SHOW_VAR array from the system variable hash. */
48
48
enumerate_sys_vars (m_current_thd, &m_show_var_array, true , m_query_scope, true );
49
49
@@ -67,7 +67,7 @@ bool PFS_system_variable_cache::do_initialize_session(void)
67
67
68
68
/* Build the array. */
69
69
bool ret= init_show_var_array (OPT_SESSION);
70
-
70
+
71
71
mysql_mutex_unlock (&LOCK_plugin_delete);
72
72
return ret;
73
73
}
@@ -194,7 +194,7 @@ void PFS_system_variable_cache::free_mem_root(void)
194
194
int PFS_system_variable_cache::do_materialize_session (PFS_thread *pfs_thread)
195
195
{
196
196
int ret= 1 ;
197
-
197
+
198
198
m_pfs_thread= pfs_thread;
199
199
m_materialized= false ;
200
200
m_cache.clear ();
@@ -208,7 +208,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
208
208
/* Use a temporary mem_root to avoid depleting THD mem_root. */
209
209
if (m_use_mem_root)
210
210
set_mem_root ();
211
-
211
+
212
212
/* Get and lock a validated THD from the thread manager. */
213
213
if ((m_safe_thd= get_THD (pfs_thread)) != NULL )
214
214
{
@@ -232,7 +232,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
232
232
m_materialized= true ;
233
233
ret= 0 ;
234
234
}
235
-
235
+
236
236
/* Mark mem_root blocks as free. */
237
237
if (m_use_mem_root)
238
238
clear_mem_root ();
@@ -249,7 +249,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
249
249
int PFS_system_variable_cache::do_materialize_session (PFS_thread *pfs_thread, uint index)
250
250
{
251
251
int ret= 1 ;
252
-
252
+
253
253
m_pfs_thread= pfs_thread;
254
254
m_materialized= false ;
255
255
m_cache.clear ();
@@ -264,7 +264,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui
264
264
if ((m_safe_thd= get_THD (pfs_thread)) != NULL )
265
265
{
266
266
SHOW_VAR *show_var= &m_show_var_array.at (index );
267
-
267
+
268
268
if (show_var && show_var->value &&
269
269
(show_var != m_show_var_array.end ()))
270
270
{
@@ -285,7 +285,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui
285
285
m_materialized= true ;
286
286
ret= 0 ;
287
287
}
288
-
288
+
289
289
mysql_mutex_unlock (&LOCK_plugin_delete);
290
290
return ret;
291
291
}
@@ -662,7 +662,7 @@ bool PFS_status_variable_cache::init_show_var_array(enum_var_type scope)
662
662
663
663
/* Get the latest version of all_status_vars. */
664
664
m_version= get_status_vars_version ();
665
-
665
+
666
666
/* Increase cache size if necessary. */
667
667
m_cache.reserve (m_show_var_array.size ());
668
668
@@ -708,7 +708,7 @@ char * PFS_status_variable_cache::make_show_var_name(const char* prefix, const c
708
708
{
709
709
DBUG_ASSERT (name_buf != NULL );
710
710
char *prefix_end= name_buf;
711
-
711
+
712
712
if (prefix && *prefix)
713
713
{
714
714
/* Drop the prefix into the front of the name buffer. */
@@ -748,7 +748,7 @@ bool PFS_status_variable_cache::do_initialize_session(void)
748
748
749
749
bool ret= init_show_var_array (OPT_SESSION);
750
750
751
- if (m_current_thd->fill_status_recursion_level -- == 1 )
751
+ if (m_current_thd->fill_status_recursion_level -- == 1 )
752
752
mysql_mutex_unlock (&LOCK_status);
753
753
754
754
return ret;
@@ -766,7 +766,7 @@ int PFS_status_variable_cache::do_materialize_global(void)
766
766
/* Acquire LOCK_status to guard against plugin load/unload. */
767
767
if (m_current_thd->fill_status_recursion_level ++ == 0 )
768
768
mysql_mutex_lock (&LOCK_status);
769
-
769
+
770
770
/*
771
771
Build array of SHOW_VARs from global status array. Do this within
772
772
LOCK_status to ensure that the array remains unchanged during
@@ -792,7 +792,7 @@ int PFS_status_variable_cache::do_materialize_global(void)
792
792
*/
793
793
manifest (m_current_thd, m_show_var_array.begin (), &status_totals, " " , false );
794
794
795
- if (m_current_thd->fill_status_recursion_level -- == 1 )
795
+ if (m_current_thd->fill_status_recursion_level -- == 1 )
796
796
mysql_mutex_unlock (&LOCK_status);
797
797
798
798
m_materialized= true ;
@@ -840,7 +840,7 @@ int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
840
840
ret= 0 ;
841
841
}
842
842
843
- if (m_current_thd->fill_status_recursion_level -- == 1 )
843
+ if (m_current_thd->fill_status_recursion_level -- == 1 )
844
844
mysql_mutex_unlock (&LOCK_status);
845
845
return ret;
846
846
}
@@ -861,7 +861,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
861
861
/* Acquire LOCK_status to guard against plugin load/unload. */
862
862
if (m_current_thd->fill_status_recursion_level ++ == 0 )
863
863
mysql_mutex_lock (&LOCK_status);
864
-
864
+
865
865
/* The SHOW_VAR array must be initialized externally. */
866
866
DBUG_ASSERT (m_initialized);
867
867
@@ -880,8 +880,8 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
880
880
m_materialized= true ;
881
881
ret= 0 ;
882
882
}
883
-
884
- if (m_current_thd->fill_status_recursion_level -- == 1 )
883
+
884
+ if (m_current_thd->fill_status_recursion_level -- == 1 )
885
885
mysql_mutex_unlock (&LOCK_status);
886
886
return ret;
887
887
}
@@ -913,14 +913,14 @@ int PFS_status_variable_cache::do_materialize_client(PFS_client *pfs_client)
913
913
from disconnected threads.
914
914
*/
915
915
m_sum_client_status (pfs_client, &status_totals);
916
-
916
+
917
917
/*
918
918
Build the status variable cache using the SHOW_VAR array as a reference and
919
919
the status totals collected from threads associated with this client.
920
920
*/
921
921
manifest (m_current_thd, m_show_var_array.begin (), &status_totals, " " , false );
922
922
923
- if (m_current_thd->fill_status_recursion_level -- == 1 )
923
+ if (m_current_thd->fill_status_recursion_level -- == 1 )
924
924
mysql_mutex_unlock (&LOCK_status);
925
925
926
926
m_materialized= true ;
0 commit comments