Beim erforschen des Fehlers haben wir erst einmal festgestellt, dass es bei der Installation auf "localhost" mit xampp nicht auftritt. Also lässt die Servereinstellung aufhorchen. Der Serveradministrator konnte jedoch keine Ursache finden.
SQLSTATE[HY000]: General error: 1005 Can't create table 'catalogrule_product_price_tmp' (errno: -1), query was: CREATE TEMPORARY TABLE `catalogrule_product_price_tmp` ( `grouped_id` varchar(80) NULL COMMENT 'Grouped ID' , `product_id` int UNSIGNED NULL COMMENT 'Product ID' , `customer_group_id` smallint UNSIGNED NULL COMMENT 'Customer Group ID' , `from_date` date NULL COMMENT 'From Date' , `to_date` date NULL COMMENT 'To Date' , `action_amount` decimal(12,4) NULL COMMENT 'Action Amount' , `action_operator` varchar(10) NULL COMMENT 'Action Operator' , `action_stop` smallint NULL COMMENT 'Action Stop' , `sort_order` int UNSIGNED NULL COMMENT 'Sort Order' , `price` decimal(12,4) NULL COMMENT 'Product Price' , `rule_product_id` int UNSIGNED NULL COMMENT 'Rule Product ID' , `from_time` int UNSIGNED NULL default '0' COMMENT 'From Time' , `to_time` int UNSIGNED NULL default '0' COMMENT 'To Time' , INDEX `IDX_CATALOGRULE_PRODUCT_PRICE_TMP_GROUPED_ID` (`grouped_id`) ) COMMENT='CatalogRule Price Temporary Table' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci
Wenn man den SQl Befehl ohne die Anweisung "ENGINE=INNODB" direkt in der Datenbank ausführt, funktioniert es. Aber Achtung, wer erwartet danach in der Datenbank eine neue Tabelle zu finden, wird es nicht. Denn hier wird nur eine TEMPORARY TABLE angelegt, die gleich nach dem anlegen der Daten in der eigentlichen Tabelle sofort wieder gelöscht wird. Dieses Vorgehen verbessert erheblich die Performance des online Shops.
Allerdings kann ENGINE=INNODB nicht ausgeführt werden, obwohl der SQL Server mit INNODB läuft. Was bleibt ist die php Zeile zu finden, um die Ursache zu beheben. Die Datei findet ihr unter:
app/code/core/Mage/CatalogRule/Modul/Action/Index/Refresh.php
Die Zeile 270 scheint für den Befehl verantwortlich zu sein. Diesen habe ich mit // vor der Zeile einfach auskommentiert und es funktioniert. Der Fehler taucht beim speichern des Artikels nicht mehr auf und alles andere scheint auch noch zu laufen.
Vor dem auskommentieren habe ich die Tabelle in der Datenbank selbst angelegt. Dafür in die entsprechende Datenbank des online Shops gehen und folgenden SQL Befehl ausführen:
CREATE TABLE `catalogrule_product_price_tmp` ( `grouped_id` varchar(80) NULL COMMENT 'Grouped ID' , `product_id` int UNSIGNED NULL COMMENT 'Product ID' , `customer_group_id` smallint UNSIGNED NULL COMMENT 'Customer Group ID' , `from_date` date NULL COMMENT 'From Date' , `to_date` date NULL COMMENT 'To Date' , `action_amount` decimal(12,4) NULL COMMENT 'Action Amount' , `action_operator` varchar(10) NULL COMMENT 'Action Operator' , `action_stop` smallint NULL COMMENT 'Action Stop' , `sort_order` int UNSIGNED NULL COMMENT 'Sort Order' , `price` decimal(12,4) NULL COMMENT 'Product Price' , `rule_product_id` int UNSIGNED NULL COMMENT 'Rule Product ID' , `from_time` int UNSIGNED NULL default '0' COMMENT 'From Time' , `to_time` int UNSIGNED NULL default '0' COMMENT 'To Time' , INDEX `IDX_CATALOGRULE_PRODUCT_PRICE_TMP_GROUPED_ID` (`grouped_id`) ) COMMENT='CatalogRule Price Temporary Table' ENGINE=INNODB
Eine schöne Art ist es zwar nicht, aber erstmal hilfreich. Wer dazu noch einen anderen Weg findet kann in hier gerne posten.
Ein Update zum Artikel:
Die obere Lösung funktionierte, löst aber das eigentliche Problem nicht.
Die beste Lösung ist für Magento 1.9 die Datenbank MySQL 5.6 zu nutzen. Wird ja auch unter den System Anforderung für diese Version empfohlen. http://magento.com/resources/system-requirements
Falls die Datenbank Version nicht umgestellt werden kann, funktionierte bei mir auch die Verbindung übers pdo_mysql Socket.