Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions geodiff/src/geodiffrebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,20 @@ bool _handle_update( const ChangesetEntry &entry, const RebaseMapping &mapping,
{
int newPk = mapping.getNewPkey( entry.table->name, pk );
if ( newPk == RebaseMapping::INVALID_FID )
{
// our UPDATE conflicts with their DELETE: record as conflict, delete wins
ConflictFeature conflictFeature( pk, entry.table->name );
for ( size_t i = 0; i < numColumns; i++ )
{
if ( entry.newValues[i].type() != Value::TypeUndefined )
{
_addConflictItem( conflictFeature, ( int ) i, entry.oldValues[i], Value(), entry.newValues[i] );
}
}
if ( conflictFeature.isValid() )
conflicts.push_back( conflictFeature );
return false;
}
}

// find the previously new values (will be used as the old values in the rebased version)
Expand Down
4 changes: 2 additions & 2 deletions geodiff/tests/test_concurrent_commits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ TEST( ConcurrentCommitsSqlite3Test, test_delete_update )
{
std::cout << "geopackage concurent DELETE (base) -> (A) and UPDATE (base) -> (B)" << std::endl;
std::cout << "(A) deleted the feature 2 and (B) edits the geom of feature 2" << std::endl;
std::cout << "expected result: feature 2 is deleted" << std::endl;
std::cout << "expected result: feature 2 is deleted, conflict recorded for the discarded update" << std::endl;

bool ret = _test(
"base.gpkg",
Expand All @@ -392,7 +392,7 @@ TEST( ConcurrentCommitsSqlite3Test, test_delete_update )
1,
0,
1,
0
1
);
ASSERT_TRUE( ret );
}
Expand Down
Loading