1

Someone has used the Innoext_AdvancePricing module? After upgreade to Magento 1.7 reindex crashes or inserts invalid data.

Crash stack trace:

Exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 lib/Zend/Db/Statement.php(320): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#4 lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#5 app/code/local/Innoexts/AdvancedPricing/Model/Mysql4/Catalog/Product/Indexer/Price/Configurable.php(222): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#6 app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php(50): Innoexts_AdvancedPricing_Model_Mysql4_Catalog_Product_Indexer_Price_Configurable->_applyConfigurableOption()
#7 app/code/local/Innoexts/AdvancedPricing/Model/Mysql4/Catalog/Product/Indexer/Price.php(167): Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable->reindexAll()
#8 /app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Innoexts_AdvancedPricing_Model_Mysql4_Catalog_Product_Indexer_Price->reindexAll()
#9 app/code/core/Mage/Index/Model/Process.php(209): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 app/code/core/Mage/Index/Model/Process.php(255): Mage_Index_Model_Process->reindexAll()
#11 shell/indexer.php(158): Mage_Index_Model_Process->reindexEverything()
#12 shell/indexer.php(198): Mage_Shell_Compiler->run()
#13 {main}

Invalid data in catalog_product_index_price table:

currency is always '0.0' (should be EUR, GBP etc)
store_id is always 0

I will be grateful for any help.

2
  • 1
    Asking the developer of the extension might be a better place. Or provide more information - is the extension tested to work with CE 1.7 ? Did you try to reproduce the problem in a clear database?
    – Alex
    Commented Sep 9, 2013 at 9:25
  • 1
    Yes, it is tested to work with CE 1.7 and I tried with clear database. I will also try contact with developers of extension. Thanks. Commented Sep 9, 2013 at 12:34

1 Answer 1

2

It was a mess with tables (of course because of Column count doesn't match). Somehow column from catalog_product_index_table was deleted or not added.

Additionally column order in method below is important.

Innoexts_AdvancedPricing_Model_Mysql4_Catalog_Product_Indexer_Price_Configurable::_prepareFinalPriceData()

Especially for those which are part of primary key (entity_id,customer_group_id,website_id,currency,store_id).

e.g.

    if ($this->getVersionHelper()->isGe1700()) {
        $select->columns(array(
            'group_price'      => new Zend_Db_Expr('gp.price'), 
            'base_group_price' => new Zend_Db_Expr('gp.price'), 
        )); 
    }   
    $select->columns(array(
        'currency'      => $indexerHelper->getCurrencyExpr('cw.website_id'), 
        'store_id'      => new Zend_Db_Expr('cs.store_id'), 
    ));

Could be different depends how columns are ordered in table:

    $select->columns(array(
        'currency'      => $indexerHelper->getCurrencyExpr('cw.website_id'), 
        'store_id'      => new Zend_Db_Expr('cs.store_id'), 
    ));
    if ($this->getVersionHelper()->isGe1700()) {
        $select->columns(array(
            'group_price'      => new Zend_Db_Expr('gp.price'), 
            'base_group_price' => new Zend_Db_Expr('gp.price'), 
        )); 
    }   

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.