Skip to content

A LIMIT parameter on a parenthesised part of a set operation is not applied to that part #3139

Backlog

Description

@mathiasrw
alasql('CREATE TABLE e1 (a INT); INSERT INTO e1 VALUES (1),(2),(3),(4)');
alasql('CREATE TABLE e2 (a INT); INSERT INTO e2 VALUES (5),(6),(7)');
alasql('(SELECT COLUMN a FROM e1 LIMIT 2) UNION ALL (SELECT a FROM e2 LIMIT 1)');
alasql('(SELECT COLUMN a FROM e1 LIMIT 2) UNION ALL (SELECT a FROM e2 LIMIT ?)', [1]);

It gives [1, 2, 5] with LIMIT 1 and [1, 2] with LIMIT ?.

Both should give [1, 2, 5], as SQLite does.

Fixed by #2667.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions