Skip to content
Snippets Groups Projects

feat: initial test

Open Michael Lutz requested to merge issue/drupal-3463800:3463800-allow-batchsize-to into 11.x
1 file
+ 7
9
Compare changes
  • Side-by-side
  • Inline
@@ -345,7 +345,13 @@ protected function initializeIterator() {
// Download data in batches for performance.
if (($this->batchSize > 0)) {
$this->query->range($this->batch * $this->batchSize, $this->batchSize);
// If the map is joinable or we are using highwater, then the rows we have
// processed in previous batches have already been removed from the query.
$start = match (TRUE) {
$this->mapJoinable() || $this->getHighWaterProperty() => 0,
default => $this->batch * $this->batchSize,
};
$this->query->range($start, $this->batchSize);
}
$statement = $this->query->execute();
$statement->setFetchMode(FetchAs::Associative);
@@ -432,14 +438,6 @@ protected function mapJoinable() {
if (!$this->getIds()) {
return FALSE;
}
// With batching, we want a later batch to return the same rows that would
// have been returned at the same point within a monolithic query. If we
// join to the map table, the first batch is writing to the map table and
// thus affecting the results of subsequent batches. To be safe, we avoid
// joining to the map table when batching.
if ($this->batchSize > 0) {
return FALSE;
}
$id_map = $this->migration->getIdMap();
if (!$id_map instanceof Sql) {
return FALSE;
Loading