## http://bugs.mysql.com/bug.php?id=74277 # Pulled latest bzr source 5.6.21 # Made changes to the storage/example/ha_example.cc [ushastry@ushastry mysql-5.6.21]$ diff storage/example/ha_example.cc /tmp/ha_example.cc 836,839d835 < int r = ::unlink(name); < if (r == -1) < r = errno; < assert(r == 0); 913,915d908 < int fd = ::creat(name, 0777); < assert(fd != -1); < ::close(fd); ## Compiled MySQL ushastry@ushastry mysql-5.6.21]$ cmake28 . -DCMAKE_INSTALL_PREFIX=/home/ushastry/mybuilds/mysql-5.6.21/ -DWITH_EXAMPLE_STORAGE_ENGINE=ON ushastry@ushastry mysql-5.6.21]$ make ushastry@ushastry mysql-5.6.21]$ make install // Initialized, and started /home/ushastry/mybuilds/mysql-5.6.21/scripts/mysql_install_db --basedir=/home/ushastry/mybuilds/mysql-5.6.21/ --datadir=/tmp/master --user=root /home/ushastry/mybuilds/mysql-5.6.21/bin/mysqld --basedir=/home/ushastry/mybuilds/mysql-5.6.21/ --datadir=/tmp/master --core-file --socket=/tmp/mysql.sock --port=3306 --log-error=/tmp/master/master.err --user=root 2>&1 & // Confirmed the plugin dir mysql> show variables like '%plugin_dir%'; +---------------+--------------------------------------------------+ | Variable_name | Value | +---------------+--------------------------------------------------+ | plugin_dir | /home/ushastry/mybuilds/mysql-5.6.21/lib/plugin/ | +---------------+--------------------------------------------------+ 1 row in set (0.00 sec) // Installed example storage engine mysql> INSTALL PLUGIN example SONAME 'ha_example.so'; Query OK, 0 rows affected (0.05 sec) // Confirmed that plugin installed mysql> show plugins; +----------------------------+----------+--------------------+---------------+---------+ | Name | Status | Type | Library | License | +----------------------------+----------+--------------------+---------------+---------+ .. | EXAMPLE | ACTIVE | STORAGE ENGINE | ha_example.so | GPL | +----------------------------+----------+--------------------+---------------+---------+ 43 rows in set (0.01 sec) mysql> mysql> mysql> use test Database changed mysql> mysql> create table test.t (id int) engine=example; Query OK, 0 rows affected (0.03 sec) mysql> \! ls -l /tmp/master/test total 12 -rwxrwx--x. 1 ushastry ushastry 0 Oct 28 14:32 t -rw-rw----. 1 ushastry ushastry 8556 Oct 28 14:32 t.frm mysql> create table test.s (id int) engine=example; Query OK, 0 rows affected (0.02 sec) mysql> \! ls -l /tmp/master/test total 24 -rwxrwx--x. 1 ushastry ushastry 0 Oct 28 14:33 s -rw-rw----. 1 ushastry ushastry 8556 Oct 28 14:33 s.frm -rwxrwx--x. 1 ushastry ushastry 0 Oct 28 14:32 t -rw-rw----. 1 ushastry ushastry 8556 Oct 28 14:32 t.frm mysql> mysql> drop table s; Query OK, 0 rows affected (0.00 sec) mysql> \! ls -l /tmp/master/test total 12 -rwxrwx--x. 1 ushastry ushastry 0 Oct 28 14:32 t -rw-rw----. 1 ushastry ushastry 8556 Oct 28 14:32 t.frm ### // step 7.. used bvi changed 2A with WB(42->43) Before changes [ushastry@ushastry mysql-5.6.21]$ hexdump /tmp/master/test/t.frm 0000000 01fe 2a09 0003 1000 0001 3000 0000 0010 0000010 0005 0000 0000 0000 0000 0200 0008 0008 0000020 0500 0000 0000 0008 0000 0000 0000 1000 0000030 0000 bd00 00c5 1b00 0000 0000 0000 0000 0000040 2f2f 0000 0020 0000 0000 0000 0000 0000 0000050 0000 0000 0000 0000 0000 0000 0000 0000 * 0001000 0000 0000 0002 00ff 0000 0000 0000 0000 0001010 00ff 0000 0000 0700 4500 4158 504d 454c 0001020 0000 0000 0000 000a 0000 0000 0000 0000 0001030 0000 0000 0000 0000 0000 0000 0000 0000 * 0002000 016c 1000 0000 0000 0000 0000 0000 0000 0002010 0000 0000 0000 0000 0000 0000 0000 0000 * 0002100 0001 0001 0036 000b 0000 0005 0005 0000 0002110 0000 0000 0000 0050 0016 0001 0000 0000 0002120 0036 0102 1402 2029 2020 2020 2020 2020 0002130 2020 2020 2020 2020 2020 2020 2020 2020 0002140 2020 2020 2020 2020 2020 2020 2020 0020 0002150 0004 6903 0064 0304 0b0b 0200 0000 801b 0002160 0000 0300 0008 ff00 6469 00ff 000216c After changes: [ushastry@ushastry mysql-5.6.21]$ hexdump /tmp/master/test/t.frm 0000000 01fe 2b09 0003 1000 0001 3000 0000 0010 0000010 0005 0000 0000 0000 0000 0200 0008 0008 0000020 0500 0000 0000 0008 0000 0000 0000 1000 0000030 0000 bd00 00c5 1b00 0000 0000 0000 0000 0000040 2f2f 0000 0020 0000 0000 0000 0000 0000 0000050 0000 0000 0000 0000 0000 0000 0000 0000 * 0001000 0000 0000 0002 00ff 0000 0000 0000 0000 0001010 00ff 0000 0000 0700 4500 4158 504d 454c 0001020 0000 0000 0000 000a 0000 0000 0000 0000 0001030 0000 0000 0000 0000 0000 0000 0000 0000 * 0002000 016c 1000 0000 0000 0000 0000 0000 0000 0002010 0000 0000 0000 0000 0000 0000 0000 0000 * 0002100 0001 0001 0036 000b 0000 0005 0005 0000 0002110 0000 0000 0000 0050 0016 0001 0000 0000 0002120 0036 0102 1402 2029 2020 2020 2020 2020 0002130 2020 2020 2020 2020 2020 2020 2020 2020 0002140 2020 2020 2020 2020 2020 2020 2020 0020 0002150 0004 6903 0064 0304 0b0b 0200 0000 801b 0002160 0000 0300 0008 ff00 6469 00ff 000216c ## Drop table t mysql> drop table t; Query OK, 0 rows affected (0.00 sec) // Confirmed that t.frm is deleted but t is still exists mysql> \! ls -l /tmp/master/test total 0 -rwxrwx--x. 1 ushastry ushastry 0 Oct 28 14:32 t ^^ t is left out and not cleaned despite DROP...