Skip to content

Commit 428e642

Browse files
committed
Reduce iteration count for NULL values
These are handled specifically after this loop
1 parent ac445dd commit 428e642

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Console/Command/RestoreUseDefaultValueCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ public function execute(InputInterface $input, OutputInterface $output): int
9292
foreach ($tables as $table) {
9393
// Select all non-global values
9494
$fullTableName = $this->resourceConnection->getTableName('catalog_' . $entity . '_entity_' . $table);
95-
$query = $dbRead->query("SELECT * FROM $fullTableName WHERE store_id != 0");
95+
96+
// NULL values are handled separately
97+
$query = $dbRead->query("SELECT * FROM $fullTableName WHERE store_id != 0 AND value IS NOT NULL");
9698

9799
$iterator = $this->iteratorFactory->create();
98100
$iterator->walk($query, [function (array $result) use ($column, &$counts, $dbRead, $dbWrite, $fullTableName, $isDryRun, $output): void {

0 commit comments

Comments
 (0)