Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: RETURNING * fails to expand star #4593

Closed
knz opened this issue Feb 23, 2016 · 4 comments
Closed

sql: RETURNING * fails to expand star #4593

knz opened this issue Feb 23, 2016 · 4 comments
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. help wanted Help is requested / needed by the one who filed the issue to fix it.
Milestone

Comments

@knz
Copy link
Contributor

knz commented Feb 23, 2016

Found while trying to work around #4550:

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Parse
    Length: 13
    Statement: 
    Query: BEGIN
    Parameters: 0
PostgreSQL
    Type: Bind
    Length: 12
    Portal: 
    Statement: 
    Parameter formats: 0
    Parameter values: 0
    Result formats: 0
PostgreSQL
    Type: Execute
    Length: 9
    Portal: 
    Returns: all rows
PostgreSQL
    Type: Parse
    Length: 83
    Statement: 
    Query: INSERT INTO jepsen.test ( name, val ) VALUES ( $1, $2 ) RETURNING *
    Parameters: 2
        Type OID: 1043
        Type OID: 20
PostgreSQL
    Type: Bind
    Length: 33
    Portal: 
    Statement: 
    Parameter formats: 2
        Format: Text (0)
        Format: Binary (1)
    Parameter values: 2
        Column length: 1
        Data: 61
        Column length: 8
        Data: 0000000000000000
    Result formats: 0
PostgreSQL
    Type: Describe
    Length: 6
    Portal: 
PostgreSQL
    Type: Execute
    Length: 9
    Portal: 
    Returns: all rows
PostgreSQL
    Type: Sync
    Length: 4

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Parse completion
    Length: 4

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Bind completion
    Length: 4

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Command completion
    Length: 10
    Tag: BEGIN

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Error
    Length: 52
    Severity: ERROR
    Code: XX000
    Message: qualified name """.*" not found

Internet Protocol Version 4, Src: 127.0.0.1 (127.0.0.1), Dst: 127.0.0.1 (127.0.0.1)
PostgreSQL
    Type: Ready for query
    Length: 5
    Status: In a transaction (84)

RETURNING * should succeed as soon as the table name is properly qualified.

@knz
Copy link
Contributor Author

knz commented Feb 24, 2016

Related to #4604: RETURNING on insert currently knows about already qualified column names, not stars nor other expressions.

@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. help wanted Help is requested / needed by the one who filed the issue to fix it. labels Feb 24, 2016
@knz knz added this to the Beta milestone Feb 24, 2016
@maddyblue
Copy link
Contributor

When implementing RETURNING I left this out to keep my life simpler. So this isn't a bug so much as a feature that needs to be added. (Just noting this for whoever works on it.)

@knz knz changed the title sql: RETURNING * fails to qualify even when table is qualified sql: RETURNING * fails to expand star Feb 24, 2016
@RaduBerinde RaduBerinde self-assigned this Feb 25, 2016
@RaduBerinde
Copy link
Member

I'll take a look since I touched that code in a recent PR.

RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Feb 25, 2016
This change adds support for RETURNING * in inserts and deletes. For updates we
currently only expand the updated columns; this is related to an existing
problem (we can't return other columns even explicitly; filed cockroachdb#4645).

Fixes cockroachdb#4593.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Feb 25, 2016
This change adds support for `RETURNING *` in inserts and deletes. For updates
we currently only expand the updated columns; this is related to an existing
problem (we can't return other columns even explicitly, cockroachdb#4368).

Fixes cockroachdb#4593.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Feb 25, 2016
This change adds support for `RETURNING *` in inserts and deletes. For updates
we currently only expand the updated columns; this is related to an existing
problem (we can't return other columns even explicitly, cockroachdb#4368).

Fixes cockroachdb#4593.
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this issue Feb 25, 2016
This change adds support for `RETURNING *` in inserts and deletes. For updates
we currently only expand the updated columns; this is related to an existing
problem (we can't return other columns even explicitly, cockroachdb#4368).

Fixes cockroachdb#4593.
@knz
Copy link
Contributor Author

knz commented Feb 25, 2016

While looking at #4036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. help wanted Help is requested / needed by the one who filed the issue to fix it.
Projects
None yet
Development

No branches or pull requests

3 participants