Jump to content

[Please Help Me] : Unfortunately, 2 SQL errors have occurred


Recommended Posts

Hi all,

 

I have done upgrade PS from 1.4.6.0 to 1.4.9.0 manually. But I have this problem :

 

Your shop version is now 1.4.9.0

Unfortunately, 2 SQL errors have occurred.

 

I don't know why this happen & I need help & guide how to solve this problem. Your help with many thanks.

 

Regards,

Adli

Link to comment
Share on other sites

I have 1 sql error, if you see the log you can know what's going on.

 

Mine was

 

ALTER TABLE `ps_category_product` DROP INDEX `category_product_index`, ADD PRIMARY KEY (`id_category`, `id_product`)
[u](1091) Can't DROP 'category_product_index'; check that column/key exists[/u]

 

So I delete all occurrences :

 

 


delete from ps_category_product where id_product = 5718 and id_category = 220 limit 1;
delete from ps_category_product where id_product = 5717 and id_category = 220 limit 1;

.
.
.

 

And Then i can change it:

 

 

ALTER TABLE `ps_category_product` ADD PRIMARY KEY (`id_category`, `id_product`);

 

Regards.

Edited by oka (see edit history)
Link to comment
Share on other sites

@oka, that was likely a safe error to ignore. it tried to drop an index that did not exist "category_product_index", and then replace it with a new primary key.

 

I'm not sure why you deleted 2 rows in that table, but changing the alter table command as you did was the correct action.

Link to comment
Share on other sites

Hello.

 

My explanation above is missing a few details....

 

When I do the ALTER TABLE statement to add the primary key it fails because there are duplicate entries.

 

I can't modify the table until i delete all duplicates.

 

Regards.

Link to comment
Share on other sites

Hello,

 

I also have some errors, could someone comment on them? My knowledge of SQL is a bit limited

 

SET NAMES 'utf8'

/* PHP:category_product_index_unique(); */

CREATE TABLE IF NOT EXISTS `ps_order_tax` ( `id_order` int(11) NOT NULL, `tax_name` varchar(40) NOT NULL, `tax_rate` decimal(6,3) NOT NULL, `amount` decimal(20,6) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8

INSERT INTO `ps_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('frontCanonicalRedirect', 'Front Canonical Redirect', 'Check for 404 errors before canonical redirects', 0, 0)

(1062) Duplicate entry 'frontCanonicalRedirect' for key 'hook_name'

/* PHP:update_module_pagesnotfound(); */

ALTER TABLE `ps_order_state` ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `delivery`

(1060) Duplicate column name 'deleted'

SET NAMES 'utf8'

SET NAMES 'utf8'

SET NAMES 'utf8'

SET NAMES 'utf8'

ALTER TABLE `ps_feature_product` ADD INDEX `id_product`(`id_product`)

(1061) Duplicate key name 'id_product'

SET NAMES 'utf8'

SET NAMES 'utf8'

SET NAMES 'utf8'

SET NAMES 'utf8'

ALTER TABLE `ps_image` ADD UNIQUE KEY `idx_product_image` (`id_image` , `id_product` , `cover`)

(1061) Duplicate key name 'idx_product_image'

ALTER TABLE `ps_category_product` DROP INDEX `category_product_index`, ADD PRIMARY KEY (`id_category`, `id_product`)

(1068) Multiple primary key defined

ALTER TABLE `ps_cms_category_lang` DROP INDEX `category_lang_index`, ADD PRIMARY KEY (`id_cms_category`, `id_lang`)

(1091) Can't DROP 'category_lang_index'; check that column/key exists

ALTER TABLE `ps_order_tax` ADD `id_order_tax` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST

(1060) Duplicate column name 'id_order_tax'

ALTER TABLE `ps_feature_lang` ADD INDEX feature_name (`id_lang`, `name`)

(1061) Duplicate key name 'feature_name'

ALTER TABLE `ps_state` ADD INDEX statename (`name`)

(1061) Duplicate key name 'statename'

ALTER TABLE `ps_category` ADD INDEX nleftrightactive (`nleft`, `nright`, `active`)

(1061) Duplicate key name 'nleftrightactive'

ALTER TABLE `ps_category` ADD INDEX level_depth (`level_depth`)

(1061) Duplicate key name 'level_depth'

ALTER TABLE `ps_category` ADD INDEX nright (`nright`)

(1061) Duplicate key name 'nright'

ALTER TABLE `ps_category` ADD INDEX nleft (`nleft`)

(1061) Duplicate key name 'nleft'

ALTER TABLE `ps_specific_price` ADD INDEX from_quantity (`from_quantity`)

(1061) Duplicate key name 'from_quantity'

ALTER TABLE `ps_product` ADD INDEX indexed (`indexed`)

(1061) Duplicate key name 'indexed'

UPDATE `ps_country` SET `zip_code_format` = 'NNNNN' WHERE `iso_code` = 'MC' LIMIT 1

UPDATE `ps_county_zip_code` SET `to_zip_code` = `from_zip_code` WHERE `to_zip_code` = 0

UPDATE `ps_configuration` SET `value` = 0 WHERE `name` = 'PS_HIGH_HTML_THEME_COMPRESSION' LIMIT 1

INSERT INTO `ps_configuration` (`name`, `value`, `date_add`, `date_upd`)(SELECT 'PS_TAX_DISPLAY_ALL', `value`, NOW(), NOW() FROM `ps_configuration` WHERE name = 'PS_TAX_DISPLAY' LIMIT 1)

(1062) Duplicate entry 'PS_TAX_DISPLAY_ALL' for key 'name'

DELETE FROM `ps_referrer_cache` WHERE id_referrer NOT IN (SELECT id_referrer FROM `ps_referrer`)

/* PHP:update_module_mailalerts(); */

/* PHP:update_module_blocklayered(); */

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...