[MDEV-25732] Error while removing the constraint Created: 2021-05-19  Updated: 2021-05-20  Resolved: 2021-05-20

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Владислав Сокол Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-25672 table alias from previous statement i... Closed

 Description   

CREATE TABLE A (
  id bigint NOT NULL AUTO_INCREMENT PRIMARY KEY
);
 
CREATE TABLE B (
  what tinyint NOT NULL,
  a bigint NOT NULL,
  CONSTRAINT x FOREIGN KEY (a) REFERENCES A(id),
  CONSTRAINT y CHECK (what > 0)
);
 
-- Uncommenting the next line "fixes" an error
-- INSERT INTO И VALUES (1,1);
 
SELECT b.a FROM B b;
 
-- the next statement produces an error
-- Unknown column '`db_name`.`b`.`what`' in 'CHECK'
ALTER TABLE B DROP CONSTRAINT x;

online fiddle: https://dbfiddle.uk/?rdbms=mariadb_10.3&rdbms2=mariadb_10.5&fiddle=eefa7abc9c4eab79dcef5e0c79e1e985



 Comments   
Comment by Sergei Golubchik [ 2021-05-20 ]

This is the same bug as MDEV-25672, so I will close this one for now. please use FLUSH TABLES as a temporary workaround

Generated at Thu Feb 08 09:39:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.