MCPcopy Create free account
hub / github.com/MariaDB/server / intern_sys_var_ptr

Function intern_sys_var_ptr

sql/sql_plugin.cc:3207–3227  ·  view source on GitHub ↗

returns a pointer to the memory which holds the thd-local variable or a pointer to the global variable if thd==null. If required, will sync with global variables if the requested variable has not yet been allocated in the current thread. */

Source from the content-addressed store, hash-verified

3205 has not yet been allocated in the current thread.
3206*/
3207static void *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
3208{
3209 DBUG_ENTER("intern_sys_var_ptr");
3210 DBUG_ASSERT(offset >= 0);
3211 DBUG_ASSERT((uint)offset <= global_system_variables.dynamic_variables_head);
3212
3213 if (!thd)
3214 DBUG_RETURN(global_system_variables.dynamic_variables_ptr + offset);
3215
3216 /*
3217 dynamic_variables_head points to the largest valid offset
3218 */
3219 if (!thd->variables.dynamic_variables_ptr ||
3220 (uint)offset > thd->variables.dynamic_variables_head)
3221 {
3222 mysql_prlock_rdlock(&LOCK_system_variables_hash);
3223 sync_dynamic_session_variables(thd, global_lock);
3224 mysql_prlock_unlock(&LOCK_system_variables_hash);
3225 }
3226 DBUG_RETURN(thd->variables.dynamic_variables_ptr + offset);
3227}
3228
3229
3230/**

Callers 13

mysql_sys_var_charFunction · 0.85
mysql_sys_var_intFunction · 0.85
mysql_sys_var_uintFunction · 0.85
mysql_sys_var_longFunction · 0.85
mysql_sys_var_ulongFunction · 0.85
mysql_sys_var_longlongFunction · 0.85
mysql_sys_var_ulonglongFunction · 0.85
mysql_sys_var_strFunction · 0.85
mysql_sys_var_doubleFunction · 0.85
real_value_ptrMethod · 0.85
session_is_defaultMethod · 0.85
thd_getspecificFunction · 0.85

Calls 1

Tested by

no test coverage detected