this bug is repeatable in Percona Server 5.5.24, but can not repeat in Percona Server 5.5.18.
below is the stack
#0 increment_count_by_name (name=0xdfb4f0 "#mysql_system#", role_name=0xdfb4f0 "#mysql_system#", users_or_clients=0xe4c280, thd=0x3f0bc50) at /tmp/Percona-Server-5.5.24-rel26.0/sql/sql_connect.cc:468 #1 0x000000000060eee4 in update_global_user_stats (thd=0x3f0bc50, create_user=true, now=1338860077) at /tmp/Percona-Server-5.5.24-rel26.0/sql/sql_connect.cc:668 #2 0x00000000005702b5 in mysql_parse (thd=0x3f0bc50, rawbuf=0x3f20ad0 "create database db27", length=66115608, parser_state=0x4a2933d0) at /tmp/Percona-Server-5.5.24-rel26.0/sql/sql_parse.cc:5869 #3 0x0000000000741359 in Query_log_event::do_apply_event (this=0x3f0f990, rli=0x3ec3c98, query_arg=0x3f0faa9 "create database db27", q_len_arg=20) at /tmp/Percona-Server-5.5.24-rel26.0/sql/log_event.cc:3440 #4 0x0000000000503f3e in apply_event (rli=<optimized out>, this=<optimized out>) at /tmp/Percona-Server-5.5.24-rel26.0/sql/log_event.h:1136 #5 apply_event_and_update_pos (ev=0x3f0f990, thd=<optimized out>, rli=0x3ec3c98) at /tmp/Percona-Server-5.5.24-rel26.0/sql/slave.cc:2401 #6 0x0000000000506527 in exec_relay_log_event (thd=0x3f0bc50, rli=0x3ec3c98) at /tmp/Percona-Server-5.5.24-rel26.0/sql/slave.cc:2561 #7 0x000000000050ac34 in handle_slave_sql (arg=<optimized out>) at /tmp/Percona-Server-5.5.24-rel26.0/sql/slave.cc:3378 #8 0x0000003e638064a7 in start_thread () from /lib64/libpthread.so.0 #9 0x0000003e630d3c2d in clone () from /lib64/libc.so.6 #10 0x0000000000000000 in ?? () (gdb) p thd->net.vio $4 = (Vio *) 0x0
and in function increment_count_by_name, thd->net.vio is used:
542 if (thd->net.vio->type == VIO_TYPE_SSL) 543 thread_stats->total_ssl_connections++; 544 return 0;
this code can be changed like this: if ( !thd->slave_thread && thd->net.vio->type == VIO_TYPE_SSL) thread_stats->total_ssl_connections++;
because in sql thread, thd->net.vio is always 0x0
this bug is repeatable in Percona Server 5.5.24, but can not repeat in Percona Server 5.5.18.
below is the stack
#0 increment_ count_by_ name (name=0xdfb4f0 "#mysql_system#", role_name=0xdfb4f0 "#mysql_system#", users_or_ clients= 0xe4c280, thd=0x3f0bc50) Server- 5.5.24- rel26.0/ sql/sql_ connect. cc:468 global_ user_stats (thd=0x3f0bc50, create_user=true, now=1338860077) Server- 5.5.24- rel26.0/ sql/sql_ connect. cc:668 state=0x4a2933d 0) Server- 5.5.24- rel26.0/ sql/sql_ parse.cc: 5869 event:: do_apply_ event (this=0x3f0f990, rli=0x3ec3c98, query_arg=0x3f0faa9 "create database db27", q_len_arg=20) Server- 5.5.24- rel26.0/ sql/log_ event.cc: 3440 Server- 5.5.24- rel26.0/ sql/log_ event.h: 1136 and_update_ pos (ev=0x3f0f990, thd=<optimized out>, rli=0x3ec3c98) at /tmp/Percona- Server- 5.5.24- rel26.0/ sql/slave. cc:2401 log_event (thd=0x3f0bc50, rli=0x3ec3c98) at /tmp/Percona- Server- 5.5.24- rel26.0/ sql/slave. cc:2561 Server- 5.5.24- rel26.0/ sql/slave. cc:3378 libpthread. so.0
at /tmp/Percona-
#1 0x000000000060eee4 in update_
at /tmp/Percona-
#2 0x00000000005702b5 in mysql_parse (thd=0x3f0bc50, rawbuf=0x3f20ad0 "create database db27", length=66115608, parser_
at /tmp/Percona-
#3 0x0000000000741359 in Query_log_
at /tmp/Percona-
#4 0x0000000000503f3e in apply_event (rli=<optimized out>, this=<optimized out>) at /tmp/Percona-
#5 apply_event_
#6 0x0000000000506527 in exec_relay_
#7 0x000000000050ac34 in handle_slave_sql (arg=<optimized out>) at /tmp/Percona-
#8 0x0000003e638064a7 in start_thread () from /lib64/
#9 0x0000003e630d3c2d in clone () from /lib64/libc.so.6
#10 0x0000000000000000 in ?? ()
(gdb) p thd->net.vio
$4 = (Vio *) 0x0
and in function increment_ count_by_ name, thd->net.vio is used:
542 if (thd->net.vio->type == VIO_TYPE_SSL) stats-> total_ssl_ connections+ +;
543 thread_
544 return 0;
this code can be changed like this: stats-> total_ssl_ connections+ +;
if ( !thd->slave_thread && thd->net.vio->type == VIO_TYPE_SSL)
thread_
because in sql thread, thd->net.vio is always 0x0