SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1=1 AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price I' at line 2, query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 AS `range`, COUNT(*) AS `count` FROM `catalog_product_index_price` AS `e` INNER JOIN catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '2' WHERE 1=1 AND (e.entity_id IN('135')) 1=1 AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 ORDER BY FLOOR((ROUND((e.min_price) * 1, 2)) / 100) + 1 ASC
I have a multivendor marketplace and this error popped up when I woke up today. It happens whenever you try to go to a vendor's shop page. I can't find any syntax error. Am I blind?
After adding AND
between (e.entity_id IN('135'))
and 1=1
, the query was executed (tested by query in database). So how do I go about finding this query in code?
The rest of the error:
#0 /var/www/mywebsite.net/lib/Varien/Db/Statement/Pdo/Mysql.php(110):Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/mywebsite.net/app/code/core/Zend/Db/Statement.php(311): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /var/www/mywebsite.net/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /var/www/mywebsite.net/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT FLOOR((R...', Array)
#4 /var/www/mywebsite.net/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SELECT FLOOR((R...', Array)
#5 /var/www/mywebsite.net/lib/Zend/Db/Adapter/Abstract.php(811): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php(282): Zend_Db_Adapter_Abstract->fetchPairs(Object(Varien_Db_Select))
#7 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php(158): Mage_Catalog_Model_Resource_Layer_Filter_Price->getCount(Object(Mage_Catalog_Model_Layer_Filter_Price), 100)
#8 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php(115): Mage_Catalog_Model_Layer_Filter_Price->getRangeItemCounts(100)
#9 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php(314): Mage_Catalog_Model_Layer_Filter_Price->getPriceRange()
#10 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php(151): Mage_Catalog_Model_Layer_Filter_Price->_getItemsData()
#11 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php(120): Mage_Catalog_Model_Layer_Filter_Abstract->_initItems()
#12 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php(109): Mage_Catalog_Model_Layer_Filter_Abstract->getItems()
#13 /var/www/mywebsite.net/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php(132): Mage_Catalog_Model_Layer_Filter_Abstract->getItemsCount()
#14 /var/www/mywebsite.net/app/design/frontend/ultimo/pixel/template/catalog/layer/view.phtml(50): Mage_Catalog_Block_Layer_Filter_Abstract->getItemsCount()
#15 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/myweb...')
#16 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(276): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#17 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(290): Mage_Core_Block_Template->renderView()
#18 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#19 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#20 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#21 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#22 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#23 /var/www/mywebsite.net/app/design/frontend/ultimo/default/template/page/2columns-left.phtml(56): Mage_Core_Block_Abstract->getChildHtml('left')
#24 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(241): include('/var/www/myweb...')
#25 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(276): Mage_Core_Block_Template->fetchView('frontend/ultimo...')
#26 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Template.php(290): Mage_Core_Block_Template->renderView()
#27 /var/www/mywebsite.net/app/code/core/Mage/Core/Block/Abstract.php(919):Mage_Core_Block_Template->_toHtml()
#28 /var/www/mywebsite.net/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#29 /var/www/mywebsite.net/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#30 /var/www/mywebsite.net/app/code/local/Ced/CsMarketplace/controllers/VshopsController.php(112): Mage_Core_Controller_Varien_Action->renderLayout()
#31 /var/www/mywebsite.net/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Ced_CsMarketplace_VshopsController->viewAction()
#32 /var/www/mywebsite.net/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#33 /var/www/mywebsite.net/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#34 /var/www/mywebsite.net/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#35 /var/www/mywebsite.net/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#36 /var/www/mywebsite.net/index.php(89): Mage::run('', 'store')
#37 {main}";s:3:"url";s:22:"/vendor-shop/usershop.html/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}