Skip to content

problem parsing check constraint table definition #1454

@eyeteajay

Description

@eyeteajay

Under the table definition, there is a warning that says: "There is something wrong with this table definition that our parser doesn't fully understand." Also, the table cannot be expanded in the "database structure panel". However, the program seems to work and read the rows anyway.

Details for the issue

The problem is with ck_AssetTreeAssoc_depth, because the table definition can be parsed fine without it. My guess would be the nested parenthesis? The problem DDL is:

CREATE TABLE "AssetTreeAssoc" (
	uuid BINARY(16) NOT NULL, 
	cdt DATETIME DEFAULT (DATETIME('NOW')) NOT NULL, 
	mdt DATETIME DEFAULT (DATETIME('NOW')) NOT NULL, 
	"passetID" INTEGER NOT NULL, 
	"cassetID" INTEGER NOT NULL, 
	depth INTEGER DEFAULT 0 NOT NULL, 
	id INTEGER NOT NULL, 
	PRIMARY KEY (id), 
	CONSTRAINT "ck_AssetTreeAssoc_depth" CHECK ((passetID <> cassetID and depth > 1) or depth == 0),
	CONSTRAINT "uq_AssetTreeAssoc" UNIQUE ("cassetID", depth), 
	FOREIGN KEY("passetID") REFERENCES "AssetTree" (id) ON DELETE CASCADE, 
	FOREIGN KEY("cassetID") REFERENCES "AssetTree" (id) ON DELETE CASCADE
)

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: ___ )
  • Linux: ( distro: ___ )
  • Mac OS: ( _version: 10.11.6 )
  • Other: ___

What is your DB4S version?

  • 3.10.1
  • 3.10.0
  • 3.9.1
  • Other: ___

Did you also

Metadata

Metadata

Assignees

Labels

SQLbugConfirmed bugs or reports that are very likely to be bugs.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions