Skip to content

The column form REFERENCES p(code) checks the primary key of p instead of code #3153

Backlog

Description

@mathiasrw
alasql('CREATE TABLE p3 (id INT PRIMARY KEY, code INT UNIQUE)');
alasql('INSERT INTO p3 VALUES (1, 70)');
alasql('CREATE TABLE d3 (v INT REFERENCES p3(code))');
alasql('INSERT INTO d3 VALUES (70)');
alasql('INSERT INTO d3 VALUES (1)');

It rejects 70 with Foreign key "70" not found in table "p3" and inserts 1.

SQLite (with PRAGMA foreign_keys = ON) inserts 70 and rejects 1.

Fixed by #2662.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions