Bug #14888 server crash if there is not connection to ndb cluster
Submitted: 11 Nov 2005 23:03 Modified: 7 Feb 2006 21:04
Reporter: Oleksandr Byelkin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.0.17 OS:Linux (linux)
Assigned to: Tomas Ulin CPU Architecture:Any

[11 Nov 2005 23:03] Oleksandr Byelkin
Description:
if there is not connection to ndb cluster (we did not run it) and we use mysql client to connect to directory where is tables of ndb cluster server crashes:
#0  0x40270571 in kill () from /lib/libc.so.6
#1  0x401922d1 in pthread_kill () from /lib/libpthread.so.0
#2  0x4019269b in raise () from /lib/libpthread.so.0
#3  0x40270308 in raise () from /lib/libc.so.6
#4  0x40271790 in abort () from /lib/libc.so.6
#5  0x085ca90a in safe_mutex_lock (mp=0x8807fe0, file=0x867bdae "ha_ndbcluster.cc", line=5281) at thr_mutex.c:104
#6  0x082eb3e0 in get_share (table_name=0xbf3fb9a0 "./test/t1") at ha_ndbcluster.cc:5281
#7  0x082e817c in ha_ndbcluster::open (this=0x8873300, name=0xbf3fb9a0 "./test/t1", mode=2, test_if_locked=2) at ha_ndbcluster.cc:4314
#8  0x082bc98a in handler::ha_open (this=0x8873300, name=0xbf3fb9a0 "./test/t1", mode=2, test_if_locked=2) at handler.cc:1369
#9  0x082301bf in openfrm (thd=0x8848b48, name=0xbf3fcc20 "./test/t1", alias=0x88753a8 "t1", db_stat=8231, prgflag=44, ha_open_flags=0, outparam=0x8831c58) at table.cc:913
#10 0x08225caa in open_unireg_entry (thd=0x8848b48, entry=0x8831c58, db=0x8834508 "test", name=0x88753a8 "t1", alias=0x88753a8 "t1", table_desc=0xbf3ff6f0, mem_root=0xbf3ff580) at sql_base.cc:1751
#11 0x08224788 in open_table (thd=0x8848b48, table_list=0xbf3ff6f0, mem_root=0xbf3ff580, refresh=0xbf3ff5ab, flags=0) at sql_base.cc:1297
#12 0x08226646 in open_tables (thd=0x8848b48, start=0xbf3ff604, counter=0xbf3ff5f4, flags=0) at sql_base.cc:2019
#13 0x08227097 in open_normal_and_derived_tables (thd=0x8848b48, tables=0xbf3ff6f0, flags=0) at sql_base.cc:2356
#14 0x0830a2f4 in mysqld_list_fields (thd=0x8848b48, table_list=0xbf3ff6f0, wild=0x88753b0 "") at sql_show.cc:555
#15 0x081f6f4d in dispatch_command (command=COM_FIELD_LIST, thd=0x8848b48, packet=0x886d344 "", packet_length=4) at sql_parse.cc:1832
#16 0x081f61c4 in do_command (thd=0x8848b48) at sql_parse.cc:1510
#17 0x081f523d in handle_one_connection (arg=0x8848b48) at sql_parse.cc:1155
#18 0x4018ef1b in pthread_start_thread () from /lib/libpthread.so.0
#19 0x4018ef9f in pthread_start_thread_event () from /lib/libpthread.so.0
#20 0x40301c0a in clone () from /lib/libc.so.6
(gdb) 

How to repeat:
1) build server with ./BUILD/compile-pentium-debug-max
2) cd mysql-test
3) create file  t/ndb_test.test (the name of file does matter, we need any name which start with ndb_*) which contain:
-- source include/have_ndb.inc
create table t1 (a int) engine=ndbcluster;
4) touch r/ndb_test.result
5) ./mysql-test-run ndb_test
it will create ndb table in the test database:
[bell@sanja mysql-test]$ ls var/master-data/test/
t1.frm  t1.ndb
6) make sure that cluster is down:
killall ndb_mgmd
killall ndbd
7) ../sql/mysqld --no-defaults --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/ 
8) from other console: ./client/mysql -u root test
server will be crashed
[7 Feb 2006 21:04] Tomas Ulin
can't repeat in latest 5.0 src

I only get error messages in the error log when connecting the client

tomas@poseidon ~/mysql-5.0/mysql-test $ ../sql/mysqld --no-defaults --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
060207 22:55:24 [Note] /home/tomas/mysql-5.0/sql/.libs/lt-mysqld: ready for connections.
Version: '5.0.19'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
060207 22:55:29 [ERROR] /home/tomas/mysql-5.0/sql/.libs/lt-mysqld: Incorrect information in file: './test/t1.frm'
060207 22:55:29 [ERROR] /home/tomas/mysql-5.0/sql/.libs/lt-mysqld: Incorrect information in file: './test/t1.frm'
060207 22:56:58 [ERROR] /home/tomas/mysql-5.0/sql/.libs/lt-mysqld: Incorrect information in file: './test/t1.frm'
060207 22:56:58 [ERROR] /home/tomas/mysql-5.0/sql/.libs/lt-mysqld: Incorrect information in file: './test/t1.frm'