Hi, Sergei!
I'm writing daemon plugin . I hava a problem and don't find soultion yet.
There is my code as below.
ex)plugin.cc
-----------------------------------------------------
pthread_handler_t monm_monitor(void *p)
{
....
THD* thd;
thd = new THD;
thd->thread_stack= (char*) &thd;
tables.init_one_table("performance_schema", 18, "events_statements_current", 25, "events_statements_current", TL_READ);
open_and_lock_tables(thd, &tables, FALSE, MYSQL_LOCK_IGNORE_TIMEOUT);
.....
}
static int monm_plugin_init(void *p __attribute__ ((unused)))
{
...
pthread_create(&mon_thread, &attr, monm_monitor,(void *) ctx)!= 0)
....
}
-------------------------------------------------------------
In monm_monitor function,
THD* thd cause server crash. so I examined coredump.
#6 0x0000000000598752 in THD::THD (this=0x7f9b64000930, is_wsrep_applier=false) at /home/windfree/workspace/ws-mariadb/maria-mon/sql/sql_class.cc:1015
I don't know the reason of crash.
What I just want to is read events_statements_current's row by using internal interface in a daemon plugin.
Is there a another way ?
let me know the solution.
Regards,
Kyungnam.
|