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

Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.28, 10.1, 10.2, 10.0
    • Fix Version/s: 10.0.29
    • Labels:
      None
    • Environment:
      Gentoo Linux hardened no-multilib, kernel 4.7.10-hardened, 16 GiB RAM, Intel Xeon 64-bit CPU
    • Sprint:
      10.0.29

      Description

      Version: '10.0.28-MariaDB' Source distribution crashes after the following SQL command sequence (mysqld.err attached):

      CREATE DATABASE IF NOT EXISTS forgedImei;
      USE forgedImei;
       
      CREATE TABLE IF NOT EXISTS imei (
        id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
        imei VARCHAR(16) NOT NULL UNIQUE KEY,
        problem ENUM( 'D', 'I' ) NOT NULL,
        provInEir ENUM( 'no', 'yes' ) NOT NULL
          COMMENT "'yes' means IMEI can be provisioned in EIR."
      );
       
      CREATE TABLE IF NOT EXISTS imsi (
        id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
        imsi VARCHAR(16) NOT NULL UNIQUE KEY
      );
       
      CREATE TABLE IF NOT EXISTS pair (
        imei INT UNSIGNED NOT NULL,
        imsi INT UNSIGNED NOT NULL
      );
      

      ALTER TABLE pair
      ADD FOREIGN KEY IF NOT EXISTS (imei)
      REFERENCES imei (id)
      ON DELETE CASCADE
      ON UPDATE CASCADE;
       
      ALTER TABLE pair
      ADD FOREIGN KEY IF NOT EXISTS (imsi)
      REFERENCES imsi (id)
      ON DELETE CASCADE
      ON UPDATE CASCADE;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              attila.styevko Attila Styevko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: