Skip to content

Cannot view tables which use constraint CHECK ... IN ( .... ) #34

@dgeelen

Description

@dgeelen

When using a CHECK constraint on a column of a table which uses the IN( ... ) syntax to check that the value exists in a known set of values, the resulting table does not appear to have any columns when viewed at the "Database Structure" tab. Inserting values will still work, as will querying the table manually, but the "Browse Data" tab will show rows without any columns or data.

Example:

CREATE TABLE not_working(
    _id PRIMARY KEY NOT NULL,
    value NVARCHAR(5) CHECK (value IN ('a', 'b', 'c'))
);

CREATE TABLE working(
    _id PRIMARY KEY NOT NULL,
    value NVARCHAR(5) CHECK (value = 'a' OR value = 'b' OR value = 'c')
);

INSERT INTO not_working( _id, value ) VALUES ( 1, 'a' ), ( 2, 'b' ), ( 3, 'c' );
INSERT INTO working( _id, value ) VALUES ( 4, 'a' ), ( 5, 'b' ), ( 6, 'c' );

I'm using version 3.1.0 on Windows 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed 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