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

MERGE ... WHEN NOT MATCHED ... RETURNING returns wrong (non-null) values when no insert is performed [CORE4848] #5144

Closed
firebird-issue-importer opened this issue Jun 29, 2015 · 4 comments

Comments

@firebird-issue-importer

Submitted by: @asfernandes

Both cases returns "0, 0" instead of "null, null".

create table t1 (n1 integer, n2 integer);

-- Case 1:
merge into t1
using (
select 1 x
from rdb$database
where 1 = 0
) on 1 = 1
when not matched then
insert values (1, 11)
returning n1, n2;

-- Case 2:
merge into t1
using (
select 1 x
from rdb$database
where 1 = 1
) on 1 = 0
when not matched and 1 = 0 then
insert values (1, 11)
returning n1, n2;

Commits: 551dbdb FirebirdSQL/fbt-repository@7b257ba

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 29, 2015

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 1, 2015

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 RC 1 [ 10584 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 1, 2015

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 1, 2015

Modified by: @pavel-zotov

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

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