Comment 4 for bug 1568855

Revision history for this message
georgi iovchev (geo-pro) wrote :

It had a foreign key index, but all values were null.
Here is reproducible case:

$ mysql testdb -e"create table t0 (id int not null primary key)"
$ mysql testdb -e"create table t1 (a int, b varchar(50),c int null default null, constraint fk_t0 foreign key (c) references t0(id))"
$ mysql testdb -e"show create table t1\G"
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL,
  `b` varchar(50) COLLATE utf8_bin DEFAULT NULL,
  `c` int(11) DEFAULT NULL,
  KEY `fk_t0` (`c`),
  CONSTRAINT `fk_t0` FOREIGN KEY (`c`) REFERENCES `t0` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin

## insert 2000 rows with NULL value for the foreign key column
$ for i in {1..2000}; do mysql testdb -e"insert into t0(id) values($i); insert into t1 (a,b,c) values($RANDOM,$RANDOM,NULL)"; done

## dump t1 table
$ mydumper --rows=1000 --regex='^testdb\.t1$' --outputdir=dump
Segmentation fault