@@ -3403,8 +3403,7 @@ void alloc_and_copy_thd_dynamic_variables(THD *thd) {
3403
3403
mysql_mutex_unlock (&LOCK_system_variables_hash);
3404
3404
}
3405
3405
3406
- static bool is_regular_call () {
3407
- THD *thd = current_thd;
3406
+ static bool is_regular_call (THD *thd) {
3408
3407
if (thd == nullptr ) {
3409
3408
return true ;
3410
3409
}
@@ -3424,7 +3423,7 @@ static bool is_regular_call() {
3424
3423
3425
3424
static bool *mysql_sys_var_bool (THD *thd, int offset) {
3426
3425
bool *result;
3427
- if (is_regular_call ()) {
3426
+ if (is_regular_call (thd )) {
3428
3427
mysql_mutex_lock (&LOCK_global_system_variables);
3429
3428
result = (bool *)intern_sys_var_ptr (thd, offset);
3430
3429
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3436,7 +3435,7 @@ static bool *mysql_sys_var_bool(THD *thd, int offset) {
3436
3435
3437
3436
static int *mysql_sys_var_int (THD *thd, int offset) {
3438
3437
int *result;
3439
- if (is_regular_call ()) {
3438
+ if (is_regular_call (thd )) {
3440
3439
mysql_mutex_lock (&LOCK_global_system_variables);
3441
3440
result = (int *)intern_sys_var_ptr (thd, offset);
3442
3441
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3448,7 +3447,7 @@ static int *mysql_sys_var_int(THD *thd, int offset) {
3448
3447
3449
3448
static unsigned int *mysql_sys_var_uint (THD *thd, int offset) {
3450
3449
unsigned int *result;
3451
- if (is_regular_call ()) {
3450
+ if (is_regular_call (thd )) {
3452
3451
mysql_mutex_lock (&LOCK_global_system_variables);
3453
3452
result = (unsigned int *)intern_sys_var_ptr (thd, offset);
3454
3453
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3460,7 +3459,7 @@ static unsigned int *mysql_sys_var_uint(THD *thd, int offset) {
3460
3459
3461
3460
static unsigned long *mysql_sys_var_ulong (THD *thd, int offset) {
3462
3461
unsigned long *result;
3463
- if (is_regular_call ()) {
3462
+ if (is_regular_call (thd )) {
3464
3463
mysql_mutex_lock (&LOCK_global_system_variables);
3465
3464
result = (unsigned long *)intern_sys_var_ptr (thd, offset);
3466
3465
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3472,7 +3471,7 @@ static unsigned long *mysql_sys_var_ulong(THD *thd, int offset) {
3472
3471
3473
3472
static unsigned long long *mysql_sys_var_ulonglong (THD *thd, int offset) {
3474
3473
unsigned long long *result;
3475
- if (is_regular_call ()) {
3474
+ if (is_regular_call (thd )) {
3476
3475
mysql_mutex_lock (&LOCK_global_system_variables);
3477
3476
result = (unsigned long long *)intern_sys_var_ptr (thd, offset);
3478
3477
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3484,7 +3483,7 @@ static unsigned long long *mysql_sys_var_ulonglong(THD *thd, int offset) {
3484
3483
3485
3484
static char **mysql_sys_var_str (THD *thd, int offset) {
3486
3485
char **result;
3487
- if (is_regular_call ()) {
3486
+ if (is_regular_call (thd )) {
3488
3487
mysql_mutex_lock (&LOCK_global_system_variables);
3489
3488
result = (char **)intern_sys_var_ptr (thd, offset);
3490
3489
mysql_mutex_unlock (&LOCK_global_system_variables);
@@ -3496,7 +3495,7 @@ static char **mysql_sys_var_str(THD *thd, int offset) {
3496
3495
3497
3496
static double *mysql_sys_var_double (THD *thd, int offset) {
3498
3497
double *result;
3499
- if (is_regular_call ()) {
3498
+ if (is_regular_call (thd )) {
3500
3499
mysql_mutex_lock (&LOCK_global_system_variables);
3501
3500
result = (double *)intern_sys_var_ptr (thd, offset);
3502
3501
mysql_mutex_unlock (&LOCK_global_system_variables);
0 commit comments