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

Truncate on InnoDB with foreign key does not delete one after another

    XMLWordPrintable

    Details

      Description

      According to the documentation (https://mariadb.com/kb/en/mariadb/truncate-table/) a truncate on a table with InnoDB should empty the table by deleting the table and recreating it. If the table contains foreign keys the engine should delete row after row and trigger all foreign keys. But thats currently not the case. Currently mariadb fails with the error:

      ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint

      Thanks and greetings
      Leo

        Attachments

          Activity

            People

            Assignee:
            greenman Ian Gilfillan
            Reporter:
            leo.unglaub Leo Unglaub
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: