Skip to content

INSERT ... VALUES (DEFAULT) throws a TypeError #2791

Closed

Description

@mathiasrw

The keyword DEFAULT as a value in INSERT ... VALUES throws a TypeError. UPDATE t SET a = DEFAULT writes undefined instead (#2877).

Seen in the NIST SQL Test Suite run: 9 checks in 6 files (dml135.sql: INSERT INTO "Proj" (PNUM, PNAME, BUDGET) VALUES ('P7', 'FROB', DEFAULT), dml106.sql, ...). Reproduced on develop (38bf3c3):

alasql('CREATE TABLE t (a INT DEFAULT 7, b INT)');
alasql('INSERT INTO t VALUES (DEFAULT, 1)');
// TypeError: undefined is not an object (evaluating 'undefined['undefined']')
alasql('INSERT INTO t (a, b) VALUES (DEFAULT, 2)');
// TypeError: undefined is not an object (evaluating 'undefined['undefined']')

Expected: both rows are inserted with a = 7.

Breaking?

No. Today it throws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions