Re: [PATCH] MDEV-33031 Assertion failure upon reading from performance

Hi Sergei, Regarding 3be269542f4d18eaee0ad8fbeffa55708557879f, I have one comment (see below), otherwise ok to push.
[... 62 lines elided] diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc index 2da262cd2bc..308857d153a 100644 --- a/storage/spider/spd_param.cc +++ b/storage/spider/spd_param.cc @@ -116,16 +116,20 @@ extern volatile ulonglong spider_mon_table_cache_version_req; MYSQL_SYSVAR_NAME(param_name).def_val; \ } +extern handlerton *spider_hton_ptr; static int spider_trx_status_var(THD *thd, SHOW_VAR *var, char *buff, ulonglong SPIDER_TRX::*counter) { - int error_num = 0; - SPIDER_TRX *trx; DBUG_ENTER("spider_direct_update"); var->type = SHOW_LONGLONG; - if ((trx = spider_get_trx(thd, TRUE, &error_num))) - var->value = (char *) &(trx->*counter); - DBUG_RETURN(error_num); + var->value= buff; + if (thd != current_thd) + mysql_mutex_lock(&thd->LOCK_thd_data); + SPIDER_TRX *trx = (SPIDER_TRX*)thd_get_ha_data(thd, spider_hton_ptr); + *(ulonglong*)buff= trx ? trx->*counter : 0; + if (thd != current_thd) + mysql_mutex_unlock(&thd->LOCK_thd_data); + DBUG_RETURN(0);
If it always returns 0, how about we change the signature of this function to return void?
}
Best, Yuchen

Hi, Yuchen, On Jan 09, Yuchen Pei wrote:
Hi Sergei,
Regarding 3be269542f4d18eaee0ad8fbeffa55708557879f, I have one comment (see below), otherwise ok to push.
+extern handlerton *spider_hton_ptr; static int spider_trx_status_var(THD *thd, SHOW_VAR *var, char *buff, ulonglong SPIDER_TRX::*counter) { ... + DBUG_RETURN(0);
If it always returns 0, how about we change the signature of this function to return void?
Sure, will do. I've split the change in two commits - one is pure refactoring, the other is bug fix, and changing the function to void didn't quite fit into either one. But I'll put it with the fix now, no problem. Regards, Sergei Chief Architect, MariaDB Server and security@mariadb.org
participants (2)
-
Sergei Golubchik
-
Yuchen Pei