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

Incorrect ordering when selecting from VIEW with DISTINCT and LEFT JOIN [CORE2863] #3247

Closed
firebird-automations opened this issue Feb 14, 2010 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Svein Erling Tysvær (set)

Duplicates CORE1089
Is duplicated by CORE2870

Tom Krej asked in firebird-support 5 February a question regarding ordering when selecting from a view. I cannot see any description of what he found here, so I'm reporting what appears to be a bug. He found the bug in Firebird 2.1, but reported that it also existed in Firebird 2.0. Trying it on 2.5 RC2, I find that it is still there. Here's the simplest way to reproduce the bug:

CREATE TABLE TEST_TABLE(MYFIELD INTEGER);

CREATE VIEW TEST_VIEW(MYFIELD1, MYFIELD2) AS
SELECT DISTINCT M.MYFIELD, S.MYFIELD
FROM TEST_TABLE M
LEFT JOIN TEST_TABLE S ON M.MYFIELD = S.MYFIELD;

COMMIT;

INSERT INTO TEST_TABLE VALUES (1);
INSERT INTO TEST_TABLE VALUES (2);

COMMIT;

SELECT * FROM TEST_VIEW
ORDER BY MYFIELD1 DESC

The ordering is the same regardless of whether ASC or DESC ordering is specified.

====== Test Details ======

Test was included into core-1089.fbt as separate sample, with referece to this ticket.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue duplicates CORE1089 [ CORE1089 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Duplicates CORE1089.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE2870 [ CORE2870 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Covered by another test(s)

Test Details: Test was included into core-1089.fbt as separate sample, with referece to this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant