Skip to content

RETURNING * does not work correctly with INSERT/UPSERT #15551

@flymedllva

Description

@flymedllva

When INSERT is used together with RETURING * the operator has a strange behavior

CREATE TABLE `/local/test` (
    id Uint64,
    name Text,
    PRIMARY KEY (id)
)

Such a query returns Result(0)

INSERT INTO `test`
    (`id`)
VALUES (1) RETURNING *;
Image

In this case, if you add name to the query, the operator starts working as expected

INSERT INTO `test`
    (`id`, `name`)
VALUES (999, 'f') RETURNING *;
Image

UPSERT also works strangely, at the first insertion RETURNING does not work, but at the next one it already works

UPSERT INTO `test`
    (`id`)
VALUES (555) RETURNING *;
Image Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions