- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
这是从 v 1.3.2.4 升级而来的 v 1.4.1.1 Magento
当我尝试编辑产品时出现错误消息:
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6028-0-2' for key 'PRIMARY''
如果我尝试重新索引价格,我会在 exception.log 中看到相同的消息
我认为问题出在 catalog_product_website 表中,因为如果删除该行,我可以运行价格索引,但是当我尝试编辑产品以为其分配网站时,我得到了相同的消息。
一个奇怪的事情是 catalog_product_website 表只有 2 列,异常谈论一个 3 主键表(对吧?)
这是整个堆栈跟踪:
2010-12-07T12:12:41+00:00 ERR (3):
exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6028-0-2' for key 'PRIMARY'' in /var/www/ortoweb1314/lib/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 /var/www/ortoweb1314/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/ortoweb1314/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /var/www/ortoweb1314/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#3 /var/www/ortoweb1314/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#4 /var/www/ortoweb1314/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php(260): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#5 /var/www/ortoweb1314/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price/Default.php(133): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Default->_prepareFinalPriceData('6028')
#6 /var/www/ortoweb1314/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Product/Indexer/Price.php(192): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price_Default->reindexEntity('6028')
#7 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Indexer/Abstract.php(144): Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Indexer_Price->catalogProductSave(Object(Mage_Index_Model_Event))
#8 /var/www/ortoweb1314/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php(255): Mage_Index_Model_Indexer_Abstract->callEventHandler(Object(Mage_Index_Model_Event))
#9 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Indexer/Abstract.php(85): Mage_Catalog_Model_Product_Indexer_Price->_processEvent(Object(Mage_Index_Model_Event))
#10 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Process.php(185): Mage_Index_Model_Indexer_Abstract->processEvent(Object(Mage_Index_Model_Event))
#11 [internal function]: Mage_Index_Model_Process->processEvent(Object(Mage_Index_Model_Event))
#12 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Indexer.php(252): call_user_func_array(Array, Array)
#13 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Indexer.php(154): Mage_Index_Model_Indexer->_runAll('processEvent', Array)
#14 /var/www/ortoweb1314/app/code/core/Mage/Index/Model/Indexer.php(219): Mage_Index_Model_Indexer->indexEvent(Object(Mage_Index_Model_Event))
#15 /var/www/ortoweb1314/app/code/core/Mage/Catalog/Model/Product.php(525): Mage_Index_Model_Indexer->processEntityAction(Object(Mage_Catalog_Model_Product), 'catalog_product', 'save')
#16 [internal function]: Mage_Catalog_Model_Product->afterCommitCallback()
#17 /var/www/ortoweb1314/app/code/core/Mage/Core/Model/Resource/Abstract.php(104): call_user_func(Array)
#18 /var/www/ortoweb1314/app/code/core/Mage/Core/Model/Abstract.php(310): Mage_Core_Model_Resource_Abstract->commit()
#19 /var/www/ortoweb1314/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(663): Mage_Core_Model_Abstract->save()
#20 /var/www/ortoweb1314/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Catalog_ProductController->saveAction()
#21 /var/www/ortoweb1314/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('save')
#22 /var/www/ortoweb1314/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /var/www/ortoweb1314/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#24 /var/www/ortoweb1314/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#25 /var/www/ortoweb1314/index.php(80): Mage::run('', 'store')
#26 {main}
我希望有人能帮助我,我现在真的不知道:(
编辑:我增强了异常日志的消息,所以我可以看到整个查询,这里是:
#2 /var/www/ortoweb1314/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(
"INSERT INTO `catalog_product_index_price_final_tmp` SELECT `e`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, ta_tax_class_id.value AS `tax_class_id`, ta_price.value AS `orig_price`, IF(IF(ta_special_from_date.value IS NULL, 1, IF(DATE(ta_special_from_date.value) <= cwd.date, 1, 0)) > 0 AND IF(ta_special_to_date.value IS NULL, 1, IF(DATE(ta_special_to_date.value) >= cwd.date, 1, 0)) > 0 AND ta_special_price.value < ta_price.value, ta_special_price.value, ta_price.value) AS `price`, IF(IF(ta_special_from_date.value IS NULL, 1, IF(DATE(ta_special_from_date.value) <= cwd.date, 1, 0)) > 0 AND IF(ta_special_to_date.value IS NULL, 1, IF(DATE(ta_special_to_date.value) >= cwd.date, 1, 0)) > 0 AND ta_special_price.value < ta_price.value, ta_special_price.value, ta_price.value) AS `min_price`, IF(IF(ta_special_from_date.value IS NULL, 1, IF(DATE(ta_special_from_date.value) <= cwd.date, 1, 0)) > 0 AND IF(ta_special_to_date.value IS NULL, 1, IF(DATE(ta_special_to_date.value) >= cwd.date, 1, 0)) > 0 AND ta_special_price.value < ta_price.value, ta_special_price.value, ta_price.value) AS `max_price`, tp.min_price AS `tier_price`, tp.min_price AS `base_tier` FROM `catalog_product_entity` AS `e`
INNER JOIN `customer_group` AS `cg`
INNER JOIN `core_website` AS `cw`
INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id
INNER JOIN `core_store_group` AS `csg` ON csg.website_id = cw.website_id AND cw.default_group_id = csg.group_id
INNER JOIN `core_store` AS `cs` ON csg.default_store_id = cs.store_id AND cs.store_id != 0
INNER JOIN `catalog_product_website` AS `pw` ON pw.product_id = e.entity_id AND pw.website_id = cw.website_id
LEFT JOIN `catalog_product_index_tier_price` AS `tp` ON tp.entity_id = e.entity_id AND tp.website_id = cw.website_id AND tp.customer_group_id = cg.customer_group_id
INNER JOIN `catalog_product_entity_int` AS `tad_status` ON tad_status.entity_id = e.entity_id AND tad_status.attribute_id = 80 AND tad_status.store_id = 0
LEFT JOIN `catalog_product_entity_int` AS `tas_status` ON tas_status.entity_id = e.entity_id AND tas_status.attribute_id = 80 AND tas_status.store_id = cs.store_id
LEFT JOIN `catalog_product_entity_int` AS `ta_tax_class_id` ON ta_tax_class_id.entity_id = e.entity_id AND ta_tax_class_id.attribute_id = 81 AND ta_tax_class_id.store_id = 0
LEFT JOIN `catalog_product_entity_decimal` AS `ta_price` ON ta_price.entity_id = e.entity_id AND ta_price.attribute_id = 60 AND ta_price.store_id = 0
LEFT JOIN `catalog_product_entity_decimal` AS `ta_special_price` ON ta_special_price.entity_id = e.entity_id AND ta_special_price.attribute_id = 61 AND ta_special_price.store_id = 0
LEFT JOIN `catalog_product_entity_datetime` AS `ta_special_from_date` ON ta_special_from_date.entity_id = e.entity_id AND ta_special_from_date.attribute_id = 62 AND ta_special_from_date.store_id = 0
LEFT JOIN `catalog_product_entity_datetime` AS `ta_special_to_date` ON ta_special_to_date.entity_id = e.entity_id AND ta_special_to_date.attribute_id = 63 AND ta_special_to_date.store_id = 0
INNER JOIN `cataloginventory_stock_status` AS `ciss` ON ciss.product_id = e.entity_id AND ciss.website_id = cw.website_id WHERE (e.type_id='simple') AND (IF(tas_status.value_id > 0, tas_status.value, tad_status.value)=1) AND (e.entity_id IN('6028')) AND (ciss.stock_status=1)",
array(
),
)
整个 excpetion.log 文件在这里:http://www.dowhiletrue.net/exception.txt.tar.gz
最佳答案
看来问题不在 catalog_product_website
表中。价格指数表的问题,可能是以前版本的一些旧记录,应该删除。我建议您重新索引所有索引。完整的重建索引过程首先清除索引表,然后用数据填充表。它应该有所帮助。
如果完全重新索引没有帮助,那么您的安装可能包含观察 prepare_catalog_product_price_index_table
事件的模块,该事件以附加连接的方式修改重新索引选择,将行数乘以相同的主键。也可能会导致这样的错误。
干杯,伊万
关于在 Magento 中编辑产品时出现 MySQL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4376497/
我已经使用 vue-cli 两个星期了,直到今天一切正常。我在本地建立这个项目。 https://drive.google.com/open?id=0BwGw1zyyKjW7S3RYWXRaX24tQ
您好,我正在尝试使用 python 库 pytesseract 从图像中提取文本。请找到代码: from PIL import Image from pytesseract import image_
我的错误 /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference
我已经训练了一个模型,我正在尝试使用 predict函数但它返回以下错误。 Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]])
根据Microsoft DataConnectors的信息我想通过 this ODBC driver 创建一个从 PowerBi 到 PostgreSQL 的连接器使用直接查询。我重用了 Micros
我已经为 SoundManagement 创建了一个包,其中有一个扩展 MediaPlayer 的类。我希望全局控制这个变量。这是我的代码: package soundmanagement; impo
我在Heroku上部署了一个应用程序。我正在使用免费服务。 我经常收到以下错误消息。 PG::Error: ERROR: out of memory 如果刷新浏览器,就可以了。但是随后,它又随机发生
我正在运行 LAMP 服务器,这个 .htaccess 给我一个 500 错误。其作用是过滤关键字并重定向到相应的域名。 Options +FollowSymLinks RewriteEngine
我有两个驱动器 A 和 B。使用 python 脚本,我在“A”驱动器中创建一些文件,并运行 powerscript,该脚本以 1 秒的间隔将驱动器 A 中的所有文件复制到驱动器 B。 我在 powe
下面的函数一直返回这个错误信息。我认为可能是 double_precision 字段类型导致了这种情况,我尝试使用 CAST,但要么不是这样,要么我没有做对...帮助? 这是错误: ERROR: i
这个问题已经有答案了: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答) 已关闭
我的数据库有这个小问题。 我创建了一个表“articoli”,其中包含商品的品牌、型号和价格。 每篇文章都由一个 id (ID_ARTICOLO)` 定义,它是一个自动递增字段。 好吧,现在当我尝试插
我是新来的。我目前正在 DeVry 在线学习中级 C++ 编程。我们正在使用 C++ Primer Plus 这本书,到目前为止我一直做得很好。我的老师最近向我们扔了一个曲线球。我目前的任务是这样的:
这个问题在这里已经有了答案: What is an undefined reference/unresolved external symbol error and how do I fix it?
我的网站中有一段代码有问题;此错误仅发生在 Internet Explorer 7 中。 我没有在这里发布我所有的 HTML/CSS 标记,而是发布了网站的一个版本 here . 如您所见,我在列中有
如果尝试在 USB 设备上构建 node.js 应用程序时在我的树莓派上使用 npm 时遇到一些问题。 package.json 看起来像这样: { "name" : "node-todo",
在 Python 中,您有 None单例,在某些情况下表现得很奇怪: >>> a = None >>> type(a) >>> isinstance(a,None) Traceback (most
这是我的 build.gradle (Module:app) 文件: apply plugin: 'com.android.application' android { compileSdkV
我是 android 的新手,我的项目刚才编译和运行正常,但在我尝试实现抽屉导航后,它给了我这个错误 FAILURE: Build failed with an exception. What wen
谁能解释一下?我想我正在做一些非常愚蠢的事情,并且急切地等待着启蒙。 我得到这个输出: phpversion() == 7.2.25-1+0~20191128.32+debian8~1.gbp108
我是一名优秀的程序员,十分优秀!