-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: project set interacts badly with sorting #26720
Copy link
Copy link
Closed
Labels
C-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-0-visible-logical-errorDatabase stores inconsistent data in some cases, or queries return invalid results silently.Database stores inconsistent data in some cases, or queries return invalid results silently.
Description
Found this while investigating a test failure on #26628, the following two queries have different results even after manual reordering of result rows.
> SELECT (i.keys).n
FROM (SELECT information_schema._pg_expandarray(indkey) AS keys FROM pg_index) AS i ;> SELECT (i.keys).n
FROM (SELECT information_schema._pg_expandarray(indkey) AS keys FROM pg_index) AS i
ORDER BY 1;The specific symptom is that if all the values of n are different in the 1st query, then some of them will become duplicated in the 2nd query.
I suspect some sort node badness i.e. mutating the tuples provided by project set in-place.
@solongordon you may have seen this without realizing
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-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-0-visible-logical-errorDatabase stores inconsistent data in some cases, or queries return invalid results silently.Database stores inconsistent data in some cases, or queries return invalid results silently.