Description:
mysqld crashes when doing DDL tables restored from drop6 into MySQL Cluster using ndb_restore to restore both schema and data.
We advise to use mysqldump to get the schema and restore the tables from its dump, but it would be good to not crash mysqld and give an erro instead?
Repeatable with 6.3.26 and 6.3bzr.
How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT,
c1 INT,
PRIMARY KEY(id),
INDEX (c1)
) ENGINE=NDB;
INSERT INTO t1 (c1) VALUES (1),(3),(5),(7),(8),(11),(15);
Create the above table in a MySQL cluster running drop6p19 and make
a backup using the ndb_mgm tools.
Start a clean MySQL Cluster 6.3 and restore the previously taken
backup using ndb_restore restoring schema and data. We need to
use the --skip-table-check option for this to work.
The table created looks like this:
-- t1 --
Version: 1
Fragment type: 5
K Value: 6
Min load factor: 78
Max load factor: 80
Temporary table: no
Number of attributes: 2
Number of primary keys: 1
Length of frm data: 233
Row Checksum: 1
Row GCI: 1
SingleUserMode: 0
ForceVarPart: 0
TableStatus: Retrieved
-- Attributes --
id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
c1 Int NULL AT=FIXED ST=MEMORY
-- Indexes --
PRIMARY KEY(id) - UniqueHashIndex
c1(c1) - OrderedIndex
PRIMARY(id) - OrderedIndex
Now add a column to this table. This sometimes work with an error,
but it sometimes also crashes the mysqld. If it doesn't segfault it,
try using TRUNCATE TABLE.
stack_bottom = 0x41a84110 thread_stack 0x40000
/data1/mysql/ndb-6.3bzr/libexec/mysqld(my_print_stacktrace+0x32)[0xb140e0]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(handle_segfault+0x28a)[0x6ac50e]
/lib64/libpthread.so.0[0x3e6000e7c0]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(_ZN13ha_ndbcluster24check_if_supported_alterEP8st_tableP24st_ha_create_informationP6BitmapILj39EEj+
0x463)[0x8e658d]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(_Z17mysql_alter_tableP3THDPcS1_P24st_ha_create_informationP10TABLE_LISTP10Alter_infojP8st_orderb+0x
1825)[0x82a22b]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(_Z21mysql_execute_commandP3THD+0x23cb)[0x6bf761]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x2a5)[0x6c6771]/data1/mysql/ndb-6.3bzr/libexec/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xbe0)[0x6c7f46]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(_Z10do_commandP3THD+0x252)[0x6c9394]
/data1/mysql/ndb-6.3bzr/libexec/mysqld(handle_one_connection+0x13d)[0x6b577d]
/lib64/libpthread.so.0[0x3e600064a7]
/lib64/libc.so.6(clone+0x6d)[0x3e5f8d3c2d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x8165d98 = ALTER TABLE t1 ADD COLUMN c2 CHAR
Suggested fix:
Don't segfault on older table versions.