Skip to content

UPDATE with a table-qualified column throws a TypeError: UPDATE t SET u = t.u + 1 #2814

Open

Description

@mathiasrw

An UPDATE that names a column with its table, t.u, in SET or WHERE throws a TypeError. The same statement with the bare column name works.

Seen in the PostgreSQL regression tests run (alasql-pgsqltest): 12 statements in float4.sql, float8.sql, hash_index.sql and misc.sql, for example UPDATE FLOAT8_TBL SET f1 = FLOAT8_TBL.f1 * '-1' WHERE FLOAT8_TBL.f1 > '0.0'. Reproduced on develop (38bf3c3):

alasql('CREATE TABLE t (u INT)');
alasql('INSERT INTO t VALUES (1), (2)');
alasql('UPDATE t SET u = u + 1');             // 2
alasql('UPDATE t SET u = t.u + 1');           // TypeError: undefined is not an object (evaluating 'r['t']['u']')
alasql('UPDATE t SET u = 0 WHERE t.u > 1');   // TypeError: undefined is not an object (evaluating 'r['t']['u']')

Expected: both statements update the rows, the same as with u.

Breaking?

No. Today they throw.

Related: #2792 (the same error from a correlated subquery in UPDATE and DELETE, probably the same cause).

Activity

  1. mateuscmtropical commented on Nov 11, 2026

    @mateuscmtropical
    Contributor

    Hi, I'd like to work on this one.

  2. mateuscmtropical commented on Nov 11, 2026

    @mateuscmtropical
    Contributor

    Hi, I've opened a PR for this: #2991

  3. modified the milestones: v4.x Focus, v5.0.0 on Nov 15, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions