Problem/Motivation

$key = $target_id . $target_type . $source_id . $source_type . $source_langcode . ($source_vid ?: 0) . $method . $field_name;

Concatenating fields without a separator means two distinct tuples can theoretically produce the same string key (e.g. target_id=1 + target_type="2x" vs target_id=12 + target_type="x"), causing one row to silently overwrite another in $this->inserts before the bulk insert runs. Low likelihood given typical machine-name entity types, but cheap to fix by joining with a delimiter (e.g. "\0").

Proposed resolution

Use a delimiter.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

  • alexpott committed 3063a63b on 5.x
    fix: #3612696 Bulk-insert dedup key can collide
    
    By: alexpott
    

  • alexpott committed 7026e2f7 on 8.x-2.x
    fix: #3612696 Bulk-insert dedup key can collide
    
    By: alexpott
    
alexpott’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

alexpott’s picture

Version: 5.x-dev » 8.x-2.x-dev