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

CREATE OR REPLACE only drops InnoDB table used by OQGRAPH

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0.11, 10.0
    • Fix Version/s: 10.0
    • Labels:
      None

      Description

      1) create & populate an InnoDB table
      2) create an OQGRAPH table based on the prev table
      3) select from the second table at least once
      4) CREATE OR REPLACE first table
      Result: first table is dropped but not recreated, misleading error is shown.

      CREATE TABLE t (
      	a INT NOT NULL,
      	b INT NOT NULL
      ) ENGINE = InnoDB;
      
      INSERT INTO t (a, b) VALUES (1, 10), (2, 10), (3, 10);
      
      CREATE TABLE oq (
        latch VARCHAR(32) NULL,
        origid BIGINT UNSIGNED NULL,
        destid BIGINT UNSIGNED NULL,
        weight DOUBLE NULL,
        seq BIGINT UNSIGNED NULL,
        linkid BIGINT UNSIGNED NULL,
        KEY (latch, origid, destid) USING HASH,
        KEY (latch, destid, origid) USING HASH
      ) 
      	ENGINE = OQGRAPH 
      	DATA_TABLE = 't'
      	ORIGID = 'a'
      	DESTID = 'b';
      
      SELECT *
      	FROM oq
      	WHERE latch = 'dijkstras'
      		AND origid = 1
      		AND destid = 10;
      
      CREATE OR REPLACE TABLE t (
      	a INT,
      	b INT
      ) ENGINE = InnoDB;
      
      SELECT * FROM t;
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -
              query 'CREATE OR REPLACE TABLE t (
              a INT,
              b INT
              ) ENGINE = InnoDB' failed: 1813: Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT.
              

              Apparently it's a sequel of MDEV-5891 family – before the OQGRAPH merge made by revno 4184 an InnoDB table couldn't be used at all, now it can, but with problems as above.

              Show
              elenst Elena Stepanova added a comment - query 'CREATE OR REPLACE TABLE t ( a INT, b INT ) ENGINE = InnoDB' failed: 1813: Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT. Apparently it's a sequel of MDEV-5891 family – before the OQGRAPH merge made by revno 4184 an InnoDB table couldn't be used at all, now it can, but with problems as above.
              Hide
              f_razzoli Federico Razzoli added a comment -

              I forgot: after that testcase, I cannot recreate the InnoDB table.

              MariaDB [test]> CREATE TABLE t (
                  -> a INT NOT NULL,
                  -> b INT NOT NULL
                  -> ) ENGINE = InnoDB;
              ERROR 1813 (HY000): Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT.
              Error (Code 1813): Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT.
              Warning (Code 1030): Got error 184 "Tablespace already exists" from storage engine InnoDB
              
              Show
              f_razzoli Federico Razzoli added a comment - I forgot: after that testcase, I cannot recreate the InnoDB table. MariaDB [test]> CREATE TABLE t ( -> a INT NOT NULL, -> b INT NOT NULL -> ) ENGINE = InnoDB; ERROR 1813 (HY000): Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT. Error (Code 1813): Tablespace for table '`test`.`t`' exists. Please DISCARD the tablespace before IMPORT. Warning (Code 1030): Got error 184 "Tablespace already exists" from storage engine InnoDB
              Hide
              elenst Elena Stepanova added a comment -

              See also MDEV-7355

              Show
              elenst Elena Stepanova added a comment - See also MDEV-7355

                People

                • Assignee:
                  andymc73 Andrew McDonnell
                  Reporter:
                  f_razzoli Federico Razzoli
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: