Bug #30001 'drop table' crash mysqld after ndbcluster restarted when statement binlogformat
Submitted: 24 Jul 2007 8:44 Modified: 1 Aug 2007 6:33
Reporter: justin he Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1.19-beta OS:Any
Assigned to: justin he CPU Architecture:Any

[24 Jul 2007 8:44] justin he
Description:
source tree:
  mysql-5.1-new-ndb  5.1.19-beta

read following steps to reproduce it.

How to repeat:
1. run cluster 
   mysqld should run with --binlog-format=statement

2. use mysql client to create a ndb table and insert one row
[justin.he@TURBO src]$ mysql -u root -S /tmp/mysql.sock
mysql> use test;
Database changed
mysql> show tables;
Empty set (0.05 sec)

mysql> create table t1 (a int key) engine=ndbcluster;
Query OK, 0 rows affected (1.02 sec)

mysql> insert into t1 values (1);
Query OK, 1 row affected (0.03 sec)

mysql> select * from t1;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.05 sec)

3. on another console client, restart ndbcluster and wait all data nodes restarted.
[justin.he@TURBO 5.1-new-ndb]$ storage/ndb/src/mgmclient/ndb_mgm --no-defaults -e "all restart"

[justin.he@TURBO 5.1-new-ndb]$ storage/ndb/tools/ndb_waiter --no-defaults
Connecting to mgmsrv at (null)
State node 2 STARTED
State node 3 STARTED
Waiting for cluster enter state STARTED

4. continue to do query on the mysql client
mysql> select * from t1;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.02 sec)

mysql> insert into t1 values (2);
Query OK, 1 row affected (0.00 sec)

mysql> select * from t1;
+---+
| a |
+---+
| 1 |
| 2 |
+---+
2 rows in set (0.05 sec)

mysql> drop table t1;
ERROR 1051 (42S02): Unknown table 't1'
mysql> show warnings;
+-------+------+----------------------------------------------------+
| Level | Code | Message                                            |
+-------+------+----------------------------------------------------+
| Error |  157 | Got error 157 'Unknown error code' from NDBCLUSTER |
+-------+------+----------------------------------------------------+
1 row in set (0.00 sec)

5. quit the mysql client, and run it again and drop table will cause mysqld crash:
mysql> quit
Bye

[justin.he@TURBO src]$ mysql -u root -S /tmp/mysql.sock

mysql> use test;
Database changed
mysql> drop table t1;
ERROR 2013 (HY000): Lost connection to MySQL server during query