[MDEV-7354] CREATE OR REPLACE only drops InnoDB table used by OQGRAPH Created: 2014-12-20  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - OQGRAPH
Affects Version/s: 10.0.11, 10.0
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Andrew McDonnell
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-7355 CREATE OR REPLACE with MyISAM + OQGRAPH Open

 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;



 Comments   
Comment by Elena Stepanova [ 2014-12-20 ]

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.

Comment by Federico Razzoli [ 2014-12-20 ]

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

Comment by Elena Stepanova [ 2014-12-20 ]

See also MDEV-7355

Generated at Thu Feb 08 07:18:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.