File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
app/code/Magento/Catalog/Model/Indexer/Category/Product Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,8 @@ protected function reindex(): void
205205 private function reindexStore ($ store ): void
206206 {
207207 // Ensure the same adapter instance that created the TEMP table is used for all operations
208- $ this ->connection = $ this ->tableMaintainer ->getConnection ();
208+ // phpcs:ignore
209+ $ this ->connection = $ this ->tableMaintainer ->getSameAdapterConnection ();
209210 $ this ->reindexRootCategory ($ store );
210211 $ this ->reindexAnchorCategories ($ store );
211212 $ this ->reindexNonAnchorCategories ($ store );
Original file line number Diff line number Diff line change @@ -69,14 +69,25 @@ public function __construct(
6969 *
7070 * @return AdapterInterface
7171 */
72- public function getConnection ()
72+ private function getConnection ()
7373 {
7474 if (!isset ($ this ->connection )) {
7575 $ this ->connection = $ this ->resource ->getConnection ();
7676 }
7777 return $ this ->connection ;
7878 }
7979
80+ /**
81+ * Expose connection so callers can use the same adapter instance
82+ * that created temporary tables.
83+ *
84+ * @return AdapterInterface
85+ */
86+ public function getSameAdapterConnection (): AdapterInterface
87+ {
88+ return $ this ->getConnection ();
89+ }
90+
8091 /**
8192 * Return validated table name
8293 *
You can’t perform that action at this time.
0 commit comments