[ 
http://tracker.firebirdsql.org/browse/CORE-4618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Zotov reopened CORE-4618:
-------------------------------


WI-T3.0.0.31846: result is the same as in my issue of 08/Jan/15 03:01 PM 
(WI-T3.0.0.31532). Ticket should be reopened.

> Rollback doesn`t undo changes when MERGE statement updates the same target 
> rows multiple times and PLAN MERGE is used
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: CORE-4618
>                 URL: http://tracker.firebirdsql.org/browse/CORE-4618
>             Project: Firebird Core
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.1.5, 2.5.2, 2.1.5 Update 1, 2.5.2 Update 1, 3.0 Alpha 
> 1, 3.0 Alpha 2, 2.1.6, 2.5.3, 3.0 Beta 1
>            Reporter: Pavel Zotov
>            Assignee: Dmitry Yemanov
>             Fix For: 3.0 Beta 2, 2.5.4
>
>
> DDL:
> ####
> set term ^;
> execute block as begin
>   begin execute statement 'create sequence g'; when any do begin end end
> end
> ^ set term ;^
> commit;
> alter sequence g restart with 0;
> commit;
> recreate table t(id int, x int, y int);
> commit;
> insert into t(id) select gen_id(g,1) from rdb$types rows 3;
> update t set x=mod(id,2), y=mod(id,3);
> commit;
> Test:
> ####
> -- not affects, result the same: commit; set transaction no auto undo;
> set echo on;
> select 'before_merge' msg, t.* from t;
> set plan on;
> merge into t
> using t s
> on t.x=s.x
> when matched then update set t.x = t.x+s.y, t.y = t.y - s.x;
> set plan off;
> select 'after_merge' msg, t.* from t;
> rollback; -- <<<<<<<<<<<<<<<<<<<<<<<  ::: NB ::: must restore data to 
> previous state
> select 'after_rollback' msg, t.* from t;
> Result:
> ######
> select 'before_merge' msg, t.* from t;
> MSG                    ID            X            Y
> ============ ============ ============ ============
> before_merge            1            1            1
> before_merge            2            0            2
> before_merge            3            1            0
> set plan on;
> merge into t
> using t s
> on t.x=s.x
> when matched then update set t.x = t.x+s.y, t.y = t.y - s.x;
> PLAN MERGE (SORT (T NATURAL), SORT (S NATURAL))
> set plan off;
> select 'after_merge' msg, t.* from t;
> MSG                   ID            X            Y
> =========== ============ ============ ============
> after_merge            1            2           -1
> after_merge            2            2            2
> after_merge            3            2           -2
> rollback; --- ::: NB :::
> select 'after_rollback' msg, t.* from t;
> MSG                      ID            X            Y
> ============== ============ ============ ============
> after_rollback            1            2         -255
> after_rollback            2            0            2
> after_rollback            3            2            0
> PS. Reproduced on:
> WI-V2.5.3.26790 
> WI-T3.0.0.31395

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to