Skip to content
Snippets Groups Projects

Issue #3330911: Table destination with use_auto_increment with batch_size gives a type error

Merged Issue #3330911: Table destination with use_auto_increment with batch_size gives a type error
4 files
+ 47
6
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -183,11 +183,8 @@ class Table extends DestinationBase implements ContainerFactoryPluginInterface,
@@ -183,11 +183,8 @@ class Table extends DestinationBase implements ContainerFactoryPluginInterface,
elseif ($batch_inserts && $fieldInfo['use_auto_increment']) {
elseif ($batch_inserts && $fieldInfo['use_auto_increment']) {
if (count($this->rowsToInsert) === 0) {
if (count($this->rowsToInsert) === 0) {
// Get the highest existing ID, so we will create IDs above it.
// Get the highest existing ID, so we will create IDs above it.
$this->lastId = $this->dbConnection->query("SELECT MAX($field) AS MaxId FROM {{$this->tableName}}")
$this->lastId = (int) $this->dbConnection->query("SELECT MAX($field) AS MaxId FROM {{$this->tableName}}")
->fetchField();
->fetchField();
if (!$this->lastId) {
$this->lastId = 0;
}
}
}
$id = ++$this->lastId;
$id = ++$this->lastId;
$ids[$field] = $id;
$ids[$field] = $id;
Loading