Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

error when try to reindex product prices—Unknown column ‘gp.entity_id’ in ‘field list’
 
miszaaa
Jr. Member
 
Total Posts:  2
Joined:  2012-10-25
 

Hi All

That error appears from a beggining but now i’m gonna to fix it , cause propably that’s reason why search on that website isn’t working as well.

so when i wanna try to re-index product prices ‘ i’ve got error:

SQLSTATE[42S22]Column not found1054 Unknown column 'gp.entity_id' in 'field list'

what i’ve tried already:

-disabling all extra-modules
-reindexing by ssh
-clear var/locks folder

and nothing change

thanks for all help

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Avatar
Total Posts:  2205
Joined:  2009-11-18
Bucharest, Romania
 

Hello
The only place in the indexing process where ‘gp’ is used as a table alias is this:
Mage_Catalog_Model_Resource_Product_Indexer_Price::_prepareGroupPriceIndex() method
(at least this is what I found).
And it’s used as an alias for this table: ‘catalog_product_index_group_price’.

Maybe you have a corrupt table.
Mine has the following fields: ‘entity_id’, ‘customer_group_id’, ‘website_id’ and ‘price’:

CREATE TABLE `catalog_product_index_group_price` (                                                                                                                                       
                                     `
entity_idint(10unsigned NOT NULL COMMENT 'Entity ID',                                                                                                                             
                                     `
customer_group_idsmallint(5unsigned NOT NULL COMMENT 'Customer Group ID',                                                                                                         
                                     `
website_idsmallint(5unsigned NOT NULL COMMENT 'Website ID',                                                                                                                       
                                     `
pricedecimal(12,4) default NULL COMMENT 'Min Price',                                                                                                                                
                                     
PRIMARY KEY  (`entity_id`,`customer_group_id`,`website_id`),                                                                                                                           
                                     
KEY `IDX_CATALOG_PRODUCT_INDEX_GROUP_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),                                                                                                   
                                     
KEY `IDX_CATALOG_PRODUCT_INDEX_GROUP_PRICE_WEBSITE_ID` (`website_id`),                                                                                                                 
                                     
CONSTRAINT `FK_195DF97C81B0BDD6A2EEC50F870E16D1FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,              
                                     
CONSTRAINT `FK_CAT_PRD_IDX_GROUP_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_IDFOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,  
                                     
CONSTRAINT `FK_CAT_PRD_IDX_GROUP_PRICE_WS_ID_CORE_WS_WS_IDFOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE                    
                                   
ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Product Group Price Index Table'

Let me know if it looks the same for you.

Marius.

 
Magento Community Magento Community
Magento Community
Magento Community
 
miszaaa
Jr. Member
 
Total Posts:  2
Joined:  2012-10-25
 

i’ve added that table, and now i’ve got:

SQLSTATE[21S01]Insert value list does not match column list: 1136 Column count doesn't match value count at row 1

which im assuming is generated here:

INSERT INTO `catalog_product_index_price_final_idxSELECT `e`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, IF(IFNULL(tas_tax_class_id.value_id, -1) > 0tas_tax_class_id.valuetad_tax_class_id.value) AS `tax_class_id`, ta_price.value AS `orig_price`, IF(IF(gp.price IS NULLta_price.valuegp.price) < IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value), IF(gp.price IS NULLta_price.valuegp.price), IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value)) AS `price`, IF(IF(gp.price IS NULLta_price.valuegp.price) < IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value), IF(gp.price IS NULLta_price.valuegp.price), IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value)) AS `min_price`, IF(IF(gp.price IS NULLta_price.valuegp.price) < IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value), IF(gp.price IS NULLta_price.valuegp.price), IF(IF(ta_special_from_date.value IS NULL1, IF(DATE(ta_special_from_date.value) <= DATE(cwd.website_date), 10)) > AND IF(ta_special_to_date.value IS NULL1, IF(DATE(ta_special_to_date.value) >= DATE(cwd.website_date), 10)) > AND ta_special_price.value ta_price.valueta_special_price.valueta_price.value)) AS `max_price`, tp.min_price AS `tier_price`, tp.min_price AS `base_tier`, gp.price AS `group_price`, gp.price AS `base_group_priceFROM `catalog_product_entity` AS `e`
 
CROSS JOIN `customer_group` AS `cg`
 
CROSS JOIN `core_website` AS `cw`
 
INNER JOIN `catalog_product_index_website` AS `cwdON cw.website_id cwd.website_id
 INNER JOIN 
`core_store_group` AS `csgON csg.website_id cw.website_id AND cw.default_group_id csg.group_id
 INNER JOIN 
`core_store` AS `csON csg.default_store_id cs.store_id AND cs.store_id != 0
 INNER JOIN 
`catalog_product_website` AS `pwON pw.product_id e.entity_id AND pw.website_id cw.website_id
 LEFT JOIN 
`catalog_product_index_tier_price` AS `tpON tp.entity_id e.entity_id AND tp.website_id cw.website_id AND tp.customer_group_id cg.customer_group_id
 LEFT JOIN 
`catalog_product_index_group_price` AS `gpON gp.entity_id e.entity_id AND gp.website_id cw.website_id AND gp.customer_group_id cg.customer_group_id
 INNER JOIN 
`catalog_product_entity_int` AS `tad_statusON tad_status.entity_id e.entity_id AND tad_status.attribute_id 273 AND tad_status.store_id 0
 LEFT JOIN 
`catalog_product_entity_int` AS `tas_statusON tas_status.entity_id e.entity_id AND tas_status.attribute_id 273 AND tas_status.store_id cs.store_id
 LEFT JOIN 
`catalog_product_entity_int` AS `tad_tax_class_idON tad_tax_class_id.entity_id e.entity_id AND tad_tax_class_id.attribute_id 274 AND tad_tax_class_id.store_id 0
 LEFT JOIN 
`catalog_product_entity_int` AS `tas_tax_class_idON tas_tax_class_id.entity_id e.entity_id AND tas_tax_class_id.attribute_id 274 AND tas_tax_class_id.store_id cs.store_id
 LEFT JOIN 
`catalog_product_entity_decimal` AS `ta_priceON ta_price.entity_id e.entity_id AND ta_price.attribute_id 99 AND ta_price.store_id 0
 LEFT JOIN 
`catalog_product_entity_decimal` AS `ta_special_priceON ta_special_price.entity_id e.entity_id AND ta_special_price.attribute_id 567 AND ta_special_price.store_id 0
 LEFT JOIN 
`catalog_product_entity_datetime` AS `ta_special_from_dateON ta_special_from_date.entity_id e.entity_id AND ta_special_from_date.attribute_id 568 AND ta_special_from_date.store_id 0
 LEFT JOIN 
`catalog_product_entity_datetime` AS `ta_special_to_dateON ta_special_to_date.entity_id e.entity_id AND ta_special_to_date.attribute_id 569 AND ta_special_to_date.store_id 0 WHERE (e.type_id 'downloadable') AND (IF(IFNULL(tas_status.value_id, -1) > 0tas_status.valuetad_status.value)=1)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top