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: star expansion inside ROW is incorrect #26619

Open
knz opened this issue Jun 12, 2018 · 2 comments
Open

sql: star expansion inside ROW is incorrect #26619

knz opened this issue Jun 12, 2018 · 2 comments
Labels
A-sql-optimizer SQL logical planning and optimizations. A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3 Medium-low impact: incurs increased costs for some users (incl lower avail, recoverable bad data) T-sql-queries SQL Queries Team
Projects

Comments

@knz
Copy link
Contributor

knz commented Jun 12, 2018

The CockroachDB behavior of star expansion is incompatible with pg

> SELECT ROW(  (pg_get_keywords()).* ); -- expands the star, then make a tuple again

PostgreSQL:

                               row
------------------------------------------------------------------
 (abort,U,unreserved)
 (absolute,U,unreserved)
 (access,U,unreserved)

(i.e. the expanded tuple replaces The ROW expression)

CockroachDB:

                                    row
---------------------------------------------------------------------------
 ("(abort,U,unreserved)")
 ("(access,U,unreserved)")
 ("(action,U,unreserved)")

(i.e. the expanded tuple is converted to a string, which is incorrect)

Jira issue: CRDB-4993

@knz knz added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-pgcompat Semantic compatibility with PostgreSQL A-sql-optimizer SQL logical planning and optimizations. labels Jun 12, 2018
@knz knz added this to Triage in (DEPRECATED) SQL Front-end, Lang & Semantics via automation Jun 12, 2018
@knz knz moved this from Triage to Backlog in (DEPRECATED) SQL Front-end, Lang & Semantics Jun 12, 2018
@andy-kimball andy-kimball added this to Higher Priority Backlog in BACKLOG, NO NEW ISSUES: SQL Optimizer Aug 25, 2018
@RaduBerinde RaduBerinde moved this from Higher Priority Backlog to Plan enhancements (lower priority) in BACKLOG, NO NEW ISSUES: SQL Optimizer Apr 18, 2020
@github-actions
Copy link

github-actions bot commented Jun 6, 2021

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
5 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

@knz knz changed the title sql: perform star expansion in arbitrary tuple contexts sql: star expansion inside ROW is incorrect Jun 7, 2021
@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. and removed C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) labels Jun 7, 2021
@knz knz added this to Triage in SQL Queries via automation Jun 7, 2021
@knz knz removed this from Plan enhancements (lower priority) in BACKLOG, NO NEW ISSUES: SQL Optimizer Jun 7, 2021
@knz
Copy link
Contributor Author

knz commented Jun 7, 2021

The original issue has evolved since it was posted; now we have an outright bug.

cc @rytaft for re-triage.

@RaduBerinde RaduBerinde moved this from Triage to Backlog in SQL Queries Jun 8, 2021
@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@mgartner mgartner moved this from Backlog to Bugs to Fix in SQL Queries Mar 2, 2023
@mgartner mgartner added the S-3 Medium-low impact: incurs increased costs for some users (incl lower avail, recoverable bad data) label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-optimizer SQL logical planning and optimizations. A-sql-pgcompat Semantic compatibility with PostgreSQL C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3 Medium-low impact: incurs increased costs for some users (incl lower avail, recoverable bad data) T-sql-queries SQL Queries Team
Projects
Status: Bugs to Fix
SQL Queries
Bugs to Fix
Development

No branches or pull requests

3 participants