#
# BUG#22094601 CREATE TABLE WITH FULLTEXT AND CONSTRAINT FAILS WHEN FOREIGN_KEY_CHECKS IS 0
#

--source include/have_innodb.inc

--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 (
  id       INT NOT NULL,
  title    TEXT,
  PRIMARY  KEY (id),
  FULLTEXT KEY (title),
  FOREIGN  KEY (id) REFERENCES t2 (id)
) ENGINE=InnoDB;

CREATE TABLE t1 (
  id       INT NOT NULL,
  title    TEXT,
  PRIMARY  KEY (id)
) ENGINE=InnoDB;

--error ER_CANT_CREATE_TABLE
ALTER TABLE t1 ADD FULLTEXT KEY (title), ADD FOREIGN KEY (id) REFERENCES t2 (id);

SET FOREIGN_KEY_CHECKS = 0;

ALTER TABLE t1 ADD FULLTEXT KEY (title), ADD FOREIGN KEY (id) REFERENCES t2 (id);

DROP TABLE t1;

CREATE TABLE t1 (
  id       INT NOT NULL,
  title    TEXT,
  PRIMARY  KEY (id),
  FULLTEXT KEY (title),
  FOREIGN  KEY (id) REFERENCES t2 (id)
) ENGINE=InnoDB;

DROP TABLE t1;

SET FOREIGN_KEY_CHECKS = 1;
