Skip to content

RECORDSET OF SELECT * over a join lists a shared column twice #2636

Open

Description

@mathiasrw

RECORDSET OF SELECT * over a join lists a column twice when both tables have it, while each row has it once.

Reproduced on develop:

alasql('CREATE TABLE t (a INT, b INT, c INT); CREATE TABLE u (a INT, d INT)');
alasql('INSERT INTO t VALUES (1,2,3); INSERT INTO u VALUES (1,4)');

alasql('RECORDSET OF SELECT * FROM t JOIN u ON t.a = u.a').columns.map(c => c.columnid);
// ['a', 'b', 'c', 'a', 'd']   expected ['a', 'b', 'c', 'd']

The same happens when the result has no rows.

Direction

Build the column list for * the same way the rows are built, so a name that several sources share appears once, in the position of its first source.

Tests: the example with and without rows; t.* over the same join (already ['a', 'b', 'c']) unchanged.

Related: #2294 (columns of an empty RECORDSET).

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: #3015

  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