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

Wrong results for concatenation in derived tables [CORE3031] #3412

Closed
firebird-automations opened this issue Jun 4, 2010 · 9 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @dmitry-starodubov

Duplicates CORE2893

create or alter view test (f1, f2, f3)
as
select '1.1', '1.2', '1.3' from rdb$database
union all
select '2.1', '2.2', '2.3' from rdb$database
union all
select '3.1', '3.2', '3.3' from rdb$database

This query works OK:
select
t.f1 || '; ' || t.f2 || '; ' || t.f3 as Field1,
(
select
t.f1 || ', ' ||
t.f2 || ', ' ||
t.f3
from rdb$database
) as Field2
from test t

Result:
FIELD1 FIELD2
============= =============
1.1; 1.2; 1.3 1.1, 1.2, 1.3
2.1; 2.2; 2.3 2.1, 2.2, 2.3
3.1; 3.2; 3.3 3.1, 3.2, 3.3

But if I select * from previous query, Field2 uses values only from first record:
select *
from (
select
t.f1 || '; ' || t.f2 || '; ' || t.f3 as Field1,
(
select
t.f1 || ', ' ||
t.f2 || ', ' ||
t.f3
from rdb$database
) as Field2
from test t
)

Result:
FIELD1 FIELD2
============= =============
1.1; 1.2; 1.3 1.1, 1.2, 1.3
2.1; 2.2; 2.3 1.1, 1.2, 1.3
3.1; 3.2; 3.3 1.1, 1.2, 1.3

Commits: FirebirdSQL/fbt-repository@08c99cf

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

Test query for this ticket was added to core-2893.fbt

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

HEAD seems the only version where this problem is fixed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 2.5 RC1 [ 10362 ]

Version: 2.1.3 [ 10302 ]

Version: 2.5 Beta 1 [ 10251 ]

Version: 2.1.2 [ 10270 ]

Version: 2.0.5 [ 10222 ]

Version: 2.1.1 [ 10223 ]

Version: 2.5 Alpha 1 [ 10224 ]

Version: 2.0.4 [ 10211 ]

Version: 2.1.0 [ 10041 ]

Version: 2.0.3 [ 10200 ]

Version: 2.0.2 [ 10130 ]

Version: 2.0.1 [ 10090 ]

Version: 2.0.0 [ 10091 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Duplicates CORE2893. I'll backport it.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE2893 [ CORE2893 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@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 => Done successfully

Test Details: Test query for this ticket was added to core-2893.fbt

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