Skip to content

Commit 11d91db

Browse files
committed
MAGETWO-90148: Overlapping reindex processes of catalogrule_rule
1 parent 8782b34 commit 11d91db

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

app/code/Magento/CatalogRule/Model/Indexer/IndexerTableSwapper.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,11 @@ private function createTemporaryTable(string $originalTableName): string
4747
$originalTableName . '__temp' . $this->generateRandomSuffix()
4848
);
4949

50-
$this->resourceConnection->getConnection()->createTable(
51-
$this->resourceConnection->getConnection()->createTableByDdl(
52-
$this->resourceConnection->getTableName($originalTableName),
53-
$temporaryTableName
50+
$this->resourceConnection->getConnection()->query(
51+
sprintf(
52+
'create table %s like %s',
53+
$temporaryTableName,
54+
$this->resourceConnection->getTableName($originalTableName)
5455
)
5556
);
5657

app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/IndexerTableSwapperTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ public function testGetWorkingTableNameWithoutExistingTemporaryTable(): void
9595
->method('getTableName')
9696
->with($this->stringStartsWith($originalTableName . '__temp'))
9797
->willReturn($temporaryTableName);
98-
$this->adapterInterfaceMock->expects($this->once())
99-
->method('createTable')
100-
->willReturn($this->statementInterfaceMock);
101-
$this->adapterInterfaceMock->expects($this->once())
102-
->method('createTableByDdl')
103-
->willReturn($this->tableMock);
10498

10599
$this->assertEquals(
106100
$temporaryTableName,

0 commit comments

Comments
 (0)