Bug #37652 ref_count is incorrect when using fulltext plugin
Submitted: 26 Jun 2008 3:15 Modified: 27 Jan 2009 19:26
Reporter: Hao Wu Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.25, 5.1.30 OS:Linux (opensuse 11)
Assigned to: Assigned Account CPU Architecture:Any
Tags: fulltext, plugin

[26 Jun 2008 3:15] Hao Wu
When using fulltext plugin and 'alter table' command, mysql will report "Plugin 'simple_parser' has ref_count=xx after shutdown"

How to repeat:
compile the simple_parser plugin

shell> gcc -DMYSQL_DYNAMIC_PLUGIN -shared -I /usr/local/mysql -I /usr/local/mysql-source/include -I /usr/local/mysql-source /usr/local/mysql-source/plugin/fulltext/plugin_example.c -o simple_parser.so

install plugin

mysql> install plugin simple_parser soname 'simple_parser.so';
mysql> create table test_t (i varchar(100), fulltext index (i) with parser simple_parser);
mysql> insert into test_t values('hello world');
mysql> alter table test_t engine=myisam;

shutdown mysqld

in error.log
080626 11:13:31 [Warning] Forcing shutdown of 1 plugins
080626 11:13:31 [Note] Plugin 'simple_parser' will be forced to shutdown
080626 11:13:31 [ERROR] Plugin 'simple_parser' has ref_count=1 after shutdown.
[26 Jan 2009 22:00] Hartmut Holzgraefe
Still exists in 5.1.30:

Version: '5.1.30-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld: protocol.cc:416: void net_end_statement(THD*): Assertion `0' failed.
[26 Jan 2009 22:03] Hartmut Holzgraefe
gdb backtrace from 5.1.30:

(gdb) bt
#0  0x00007f098c35e1e6 in pthread_kill () from /lib/libpthread.so.0
#1  0x000000000099e728 in my_write_core (sig=6) at stacktrace.c:310
#2  0x0000000000641433 in handle_segfault (sig=6) at mysqld.cc:2508
#3  <signal handler called>
#4  0x00007f098b520fd5 in raise () from /lib/libc.so.6
#5  0x00007f098b522b43 in abort () from /lib/libc.so.6
#6  0x00007f098b519d49 in __assert_fail () from /lib/libc.so.6
#7  0x0000000000638425 in net_end_statement (thd=0x2d3fec8) at protocol.cc:416
#8  0x0000000000657e4a in dispatch_command (command=<value optimized out>, thd=0x2d3fec8, packet=0x2d94379 "alter table test_t engine=myisam", packet_length=47453968) at sql_parse.cc:1566
#9  0x00000000006582e3 in do_command (thd=0x2d3fec8) at sql_parse.cc:857
#10 0x000000000064921e in handle_one_connection (arg=<value optimized out>) at sql_connect.cc:1115
#11 0x00007f098c3593ea in start_thread () from /lib/libpthread.so.0
#12 0x00007f098b5d4c6d in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()
[27 Jan 2009 19:26] Sergey Vojtovich
Both problems were fixed by patch for BUG#39746 in 5.1.31. The very same test case was added as fulltext_plugin.test.

Closing as duplicate.