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

ISQL doesn`t show number of affected rows for "MERGE ... WHEN MATCHING" in case when this number surely > 0 [CORE4817] #1927

Closed
firebird-automations opened this issue May 29, 2015 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Assigned to: Claudio Valderrama C. (robocop)

Tested on WI-T3.0.0.31844, result in WI-V2.5.5.26871 is similar (just change row_number() to create sequence + gen_id).

SQL> recreate table s(id int, x int);
SQL> commit;
SQL> insert into s(id, x) select row_number()over(), 2 * row_number()over() from rdb$types rows 5;
SQL> commit;
SQL> select * from s;

      ID            X

============ ============
1 2
2 4
3 6
4 8
5 10

SQL> recreate table t(id int primary key, x int);
SQL> commit;

SQL> set count on;
SQL> merge into t using s on http://s.id = http://t.id when not matched then insert values(http://s.id, s.x);
Records affected: 5
SQL> select * from t;

      ID            X

============ ============
1 2
2 4
3 6
4 8
5 10

Records affected: 5
SQL> merge into t using s on http://s.id = http://t.id when matched then update set t.x = - 3 * s.x;

Records affected: 0 -- <<<<<<<<<<<<<<< ??? <<<<<<<<<<<<

-- Verify that last merge really changed target table:
SQL> select * from t;

      ID            X

============ ============
1 -6
2 -12
3 -18
4 -24
5 -30

Records affected: 5

Commits: 845120f b87075f FirebirdSQL/fbt-repository@4da3f9a

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

assignee: Claudio Valderrama C. [ robocop ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Backported into v2.5.6.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 2.5.6 [ 10721 ]

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