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

Constant columns getting empty value with subselect from procedure [CORE4073] #4401

Closed
firebird-automations opened this issue Apr 3, 2013 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Thomas Beckmann (thbeckmann)

Hard to describe, see this example:

set term ^ ;
create or alter procedure P_TEST returns (TEXT D_VC10) as
begin
TEXT = '12345'; suspend;
end^
set term ; ^

select A, TEXT from (select 2 as A, TEXT from P_TEST);

returns

       A TEXT

============ ==========
0 12345

and

select A, TEXT from (select '2' as A, TEXT from P_TEST);

returns

A TEXT
====== ==========
12345

If the procedure is replaced like this

select A, TEXT from (select '2' as A, '12345' as TEXT from RDB$DATABASE);

everything works fine.

Queriing like this:

select A, TEXT from (select 2 as A, TEXT from P_TEST union select null, null from RDB$DATABASE where 1=0);

works, too.

(Of course the above stuff is a simplified test case)

Commits: a74f8f1 FirebirdSQL/fbt-repository@2ba29c7

@firebird-automations
Copy link
Collaborator Author

Commented by: Thomas Beckmann (thbeckmann)

(edited headline - first I though, it would happen inside SP or EB only)

@firebird-automations
Copy link
Collaborator Author

Modified by: Thomas Beckmann (thbeckmann)

summary: Constant columns getting empty value with subselect from procedure in procedure or execute block => Constant columns getting empty value with subselect from procedure

@firebird-automations
Copy link
Collaborator Author

Modified by: Thomas Beckmann (thbeckmann)

description: Hard to describe, see this example:

set term ^ ;
create or alter procedure P_TEST returns (TEXT D_VC10) as
begin
TEXT = '12345'; suspend;
end^
set term ; ^

select A, TEXT from (select 2 as A, TEXT from P_TEST);

returns

       A TEXT

============ ==========
0 12345

and

select A, TEXT from (select '2' as A, TEXT from P_TEST);

returns

A TEXT
====== ==========
12345

If the procedure is replaced like this

select A, TEXT from (select '2' as A, '12345' as TEXT from RDB$DATABASE);

everything works fine.

(Of course the above stuff is a simplified test case)

=>

Hard to describe, see this example:

set term ^ ;
create or alter procedure P_TEST returns (TEXT D_VC10) as
begin
TEXT = '12345'; suspend;
end^
set term ; ^

select A, TEXT from (select 2 as A, TEXT from P_TEST);

returns

       A TEXT

============ ==========
0 12345

and

select A, TEXT from (select '2' as A, TEXT from P_TEST);

returns

A TEXT
====== ==========
12345

If the procedure is replaced like this

select A, TEXT from (select '2' as A, '12345' as TEXT from RDB$DATABASE);

everything works fine.

Queriing like this:

select A, TEXT from (select 2 as A, TEXT from P_TEST union select null, null from RDB$DATABASE where 1=0);

works, too.

(Of course the above stuff is a simplified test case)

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please use "Affects version = 3.0 Initial" instead of 3.0 Alpha 1 (not yet released).

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 3.0 Initial [ 10301 ]

Version: 3.0 Alpha 1 [ 10331 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Thomas Beckmann (thbeckmann)

Sorry for using the wrong version - and thank you very much for your very fast reaction! I'm looking forward to get the snapshot tonight!

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

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

2 participants