Issue Details (XML | Word | Printable)

Key: CORE-4369
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Alex Bekhtin
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

BUGCHECK(177) for MERGE with multiple matches

Created: 21/Mar/14 02:10 PM   Updated: 03/Jun/15 12:48 PM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 2

Environment: Firebird-3.0.0.30978-0_x64, Windows 7

QA Status: Done successfully
Test Details:
Confirmed result in WI-T3.0.0.31374 Beta-1: message in firebird.log
"internal Firebird consistency check (applied differences will not fit in record (177), file: sqz.cpp line: 147)"


 Description  « Hide
CREATE TABLE T1 (
    ID INTEGER,
    VAL INTEGER
);

CREATE TABLE T2 (
    ID INTEGER,
    VAL INTEGER
);

execute block as
begin
  delete from t1;
  delete from t2;
  insert into t1 (id, val)
    select row_number() over(), 10000000 from rdb$types rows 100;
  insert into t2
    select * from t1;
end

commit;

merge into t2 as trg
using (select * from t1) as src
on 1=1 --trg.id = src.id
when matched then update set trg.val = src.val

-----------------------
Unsuccessful execution caused by a system error that precludes successful execution of subsequent statements.
internal Firebird consistency check (applied differences will not fit in record (177), file: sqz.cpp line: 147).





 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dimitry Sibiryakov added a comment - 15/Apr/14 08:46 AM - edited
I've found that minimal number of rows (updates) when the bug appear is 5. At this moment record unexpectedly gets rpb_delta flag.

Something must be broken in record retrival mechanic because instead of normal (as if changes were performed by single updates) sequence update->update_in_place->update_in_place->update_in_place MERGE produces sequence update->update->update_in_place->update->update_in_place.