From 5df2290b0cc7f561749730e882bae4f5408cf709 Mon Sep 17 00:00:00 2001 From: "brandung GmbH & Co. KG" Date: Sat, 21 Jun 2014 17:10:10 +0200 Subject: [PATCH] Update Category.php Create Temporary Table('catalog_category_entity_tmp') if not Exists, after receiving "Error: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'catalog_category_entity_tmp' already exists", during Category Import. --- code/Model/Import/Entity/Category.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Model/Import/Entity/Category.php b/code/Model/Import/Entity/Category.php index ad6850d..ba00e2d 100644 --- a/code/Model/Import/Entity/Category.php +++ b/code/Model/Import/Entity/Category.php @@ -951,7 +951,7 @@ protected function _updateChildCount() $categoryTable = Mage::getSingleton('core/resource')->getTableName('catalog/category'); $categoryTableTmp = $categoryTable . '_tmp'; - $this->_connection->query("CREATE TEMPORARY TABLE {$categoryTableTmp} LIKE {$categoryTable}; + $this->_connection->query("CREATE TEMPORARY TABLE IF NOT EXISTS {$categoryTableTmp} LIKE {$categoryTable}; INSERT INTO {$categoryTableTmp} SELECT * FROM {$categoryTable}; UPDATE {$categoryTable} cce SET children_count = (