php - Issue in save product after magento upgrade 1.7 to 1.9.1.0 -
i have upgrade magento 1.7 1.9.1.0 working fine problem in product save admin section.
if add or edit product admin section show me bellow error.
sqlstate[21s01]: insert value list not match column list: 1136 column count doesn't match value count @ row 1, query was: insert `catalogrule_product_price` select null `rule_product_price_id`, `dates`.`rule_date`, `t`.`customer_group_id`, `t`.`product_id`, min(rule_price) `rule_price`, 1 `website_id`, `t`.`latest_start_date`, `t`.`earliest_end_date` (select `cppt`.`customer_group_id`, `cppt`.`product_id`, case when ifnull((@group_id), 'n/a') != cppt.grouped_id @price := case `cppt`.`action_operator` when 'to_percent' cppt.price * cppt.action_amount/100 when 'by_percent' cppt.price * (1 - cppt.action_amount/100) when 'to_fixed' if((cppt.action_amount < cppt.price), cppt.action_amount, cppt.price) when 'by_fixed' if((0 > cppt.price - cppt.action_amount), 0, cppt.price - cppt.action_amount) end when ifnull((@group_id), 'n/a') = cppt.grouped_id , ifnull((@action_stop), 0) = 0 @price := case `cppt`.`action_operator` when 'to_percent' @price * cppt.action_amount/100 when 'by_percent' @price * (1 - cppt.action_amount/100) when 'to_fixed' if((cppt.action_amount < @price), cppt.action_amount, @price) when 'by_fixed' if((0 > @price - cppt.action_amount), 0, @price - cppt.action_amount) end else @price := @price end `rule_price`, `cppt`.`from_date` `latest_start_date`, `cppt`.`to_date` `earliest_end_date`, case when ifnull((@group_id), 'n/a') != cppt.grouped_id @action_stop := cppt.action_stop when ifnull((@group_id), 'n/a') = cppt.grouped_id @action_stop := ifnull((@action_stop), 0) + cppt.action_stop end, @group_id := cppt.grouped_id, `cppt`.`from_time`, `cppt`.`to_time` `catalogrule_product_price_tmp` `cppt` order `cppt`.`grouped_id` asc, `cppt`.`sort_order` asc, `cppt`.`rule_product_id` asc) `t` inner join (select date_add(from_unixtime(1430290800), interval -1 day) rule_date union select from_unixtime(1430290800) rule_date union select date_add(from_unixtime(1430290800), interval 1 day) rule_date) `dates` on 1=1 (unix_timestamp(dates.rule_date) >= from_time) , (if((to_time = 0), 1, unix_timestamp(dates.rule_date) <= to_time)) group `customer_group_id`, `product_id`, `dates`.`rule_date`
bellow screenshot of error.
please me solve issue if have solution or suggestion issue.
some column(s) missed in table. check structure of catalogrule_product_price table. check have catalogrule_product_price_tmp table. if not, create it:
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_mmcatalogrule_product_price_tmp_grouped_id` (`grouped_id`) )
and 1 more check: may have 3-rd party modules change structure of catalogrule_product_price table. example tbt reward module add 'rules_hash' column gone after upgrade , have error. if have db dump before upgrade - check table structure custom columns , add columns new upgraded table.
Comments
Post a Comment