Skip to content

Evaluate sequence accessors per row in SELECT-list contexts (0A000 today) #314

Description

@EnRaiha

Summary

Sequence accessors in SELECT-list over table rows raise 0A000 by design
(constant contexts — FROM-less SELECT, VALUES — evaluate for real, see
#307). Per-row evaluation is the remaining step: SELECT nextval('s') FROM t should advance per output row like PostgreSQL.

Scope

Needs a plan-level CP marker plus a post-DP stamping stage in the control
response path that preserves output-row order (single-source scans first;
joins/unions ordering documented). RETURNING per-row evaluation rides the
same seam.

Related: #294, #303, #307

Reproduction

CREATE SEQUENCE s;
CREATE COLLECTION t (id BIGINT, v TEXT) WITH (engine = 'kv');
INSERT INTO t (id, v) VALUES (1, 'a'), (2, 'b');
SELECT id, nextval('s') FROM t;   -- 0A000 today; PostgreSQL: advances per row

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:sqlParser, planner, SQL semanticspriority:P2Scheduled, not urgenttype:featureNew capability or behavior change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions