Due to this problem, I'm going to use dtrace to find out what the slave SQL thread is doing with temporary tables follow this guide.
Here is my script:
#!/usr/sbin/dtrace -s
#pragma D option quiet
dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n");
}
pid$target::*mysql_parse*:entry
{
self->query = copyinstr(arg1);
}
pid$target::*Slave_open_temp_tables*:return
{
@query[self->query] = count();
}
and this is what I got when running:
# ./Slave_open_temp_tables.d -p `pgrep -x mysqld`
proc-stub:rd_event_enable
proc-stub:rd_errstr err=26
dtrace: failed to compile script ./Slave_open_temp_tables.d: line 14: probe description pid29441::*Slave_open_temp_tables*:return does not match any probes
User defined signal 1
I also have tried with create_myisam_tmp_table
but got the same result.
Where did I do wrong?