diff -u b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php --- b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php @@ -128,6 +128,7 @@ } } else { + /** @var \Drupal\Core\Database\Query\Condition $conditions */ $conditions = $this->query->orConditionGroup(); // 1. If the map is joinable, join it. We will want to accept all rows // which are either not in the map, or marked in the map as NEEDS_UPDATE. @@ -137,10 +138,12 @@ // conditions in the query). So, ultimately the SQL condition will look // like (original conditions) AND (map IS NULL OR map needs update // OR above high water). - // + $this->joinMapTable($conditions); // 2. If we are using high water marks, also include rows above the mark. // But, include all rows if the high water mark is not set. - if ($this->joinMapTable($conditions) || $this->addHighWaterProperty($conditions)) { + $this->addHighWaterProperty($conditions); + + if ($conditions->count() > 0) { $this->query->condition($conditions); } }