-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: tuple star expansion in tuple context should flatten #28203
Copy link
Copy link
Open
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-semanticsC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.T-sql-queriesSQL Queries TeamSQL Queries Team
Milestone
Description
Found by @jordanlewis while reviewing #28151 / #28143.
In postgres:
jordan=# SELECT ((i.keys).*, 123) FROM (SELECT information_schema._pg_expandarray(ARRAY[3,2,1]) AS keys) AS i;
row
-----------
(3,1,123)
(2,2,123)
(1,3,123)
In CockroachDB this gets us:
((3,1),123)
((2,2),123)
((1,3),123)
This is incorrect - the tuple should be flattened.
Jira issue: CRDB-4921
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-sql-optimizerSQL logical planning and optimizations.SQL logical planning and optimizations.A-sql-pgcompatSemantic compatibility with PostgreSQLSemantic compatibility with PostgreSQLA-sql-semanticsC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.S-3-erroneous-edge-caseDatabase produces or stores erroneous data without visible error/warning, in rare edge cases.Database produces or stores erroneous data without visible error/warning, in rare edge cases.T-sql-queriesSQL Queries TeamSQL Queries Team
Type
Projects
Status
Bugs to Fix