Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!8928
feat: initial test
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
feat: initial test
issue/drupal-3463800:3463800-allow-batchsize-to
into
11.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
Michael Lutz
requested to merge
issue/drupal-3463800:3463800-allow-batchsize-to
into
11.x
10 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Closes
#3463800
0
0
Merge request reports
Compare
11.x
11.x (HEAD)
and
latest version
latest version
d80b7c7a
1 commit,
10 months ago
1 file
+
7
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
+
7
−
9
Options
@@ -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