Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-9008

With foreign_key_checks=0 I can DROP a table, but cannot convert it to MyISAM

    Details

      Description

      CREATE OR REPLACE TABLE t1
      (
      	a INT PRIMARY KEY,
      	b INT
      )
      	ENGINE = InnoDB
      ;
       
      CREATE OR REPLACE TABLE t2
      (
      	a INT PRIMARY KEY,
      	b INT,
      	FOREIGN KEY (b) REFERENCES t1 (a)
      )
      	ENGINE = InnoDB
      ;
       
      MariaDB [test]> SET foreign_key_checks = 0;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> ALTER TABLE t2 ENGINE = MyISAM;
      ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
      MariaDB [test]> DROP TABLE t2;
      Query OK, 0 rows affected (0.00 sec)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              f_razzoli Federico Razzoli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: