0

I run into the following when trying to enable Flat Categories in the admin config. I don't know why mm is being referenced as a table and do not see it declared as a table in any of our modules.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_db.mm' doesn't exist, query was: UPDATE `mg_core_config_data` SET `scope` = ?, `scope_id` = ?, `path` = ?, `value` = ? WHERE (config_id='102')

I also see this when trying to enable quick search when editing attributes.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento_db.mm' doesn't exist, query was: UPDATE `mg_catalog_eav_attribute` SET `attribute_id` = ?, `frontend_input_renderer` = ?, `is_global` = ?, `is_visible` = ?, `is_searchable` = ?, `is_filterable` = ?, `is_comparable` = ?, `is_visible_on_front` = ?, `is_html_allowed_on_front` = ?, `is_used_for_price_rules` = ?, `is_filterable_in_search` = ?, `used_in_product_listing` = ?, `used_for_sort_by` = ?, `is_configurable` = ?, `apply_to` = ?, `is_visible_in_advanced_search` = ?, `position` = ?, `is_wysiwyg_enabled` = ?, `is_used_for_promo_rules` = ?, `search_weight` = ?, `is_recipe_attribute` = ?, `is_product_searchable` = ?, `is_recipe_searchable` = ?, `api_attribute_id` = ? WHERE (attribute_id = '147')
2
  • The error message shows that the database table mm inside the database magento_db doesn't exist. The strange this is that when you run the UPDATE query for the table mg_catalog_eav_attribute you get an error for mm table. Can you show us the complete query including values? Did you check all of your modules?
    – codedge
    May 10 '16 at 14:41
  • That is the part that I'm having trouble with. I'm not sure how to debug this further by knowing where to trigger the SQL output we are looking for.
    – TylersSN
    May 10 '16 at 14:44
0

For debugging the Magento SQL queries I recommend the following:

  • Edit lib/Varien/Db/Adapter/Pdo/Mysql.php
  • Change the following properties to true (line 106)
  • A resulting log file is created at var/debug/pdo_mysql.log
/**
 * Write SQL debug data to file
 *
 * @var bool
 */
protected $_debug               = false;

/**
 * Minimum query duration time to be logged
 *
 * @var float
 */
protected $_logQueryTime        = 0.05;

/**
 * Log all queries (ignored minimum query duration time)
 *
 * @var bool
 */
protected $_logAllQueries       = false;

/**
 * Add to log call stack data (backtrace)
 *
 * @var bool
 */
protected $_logCallStack        = false;

/**
 * Path to SQL debug data log
 *
 * @var string
 */
protected $_debugFile           = 'var/debug/pdo_mysql.log';

With that you should be able to see all the queries and debug where your wrong query is coming from.

Make sure you undo the changes after debugging.

0

That mysql debug will do nothing in this instance.

Sounds like either an upgrade to Enterprise that's gone wrong or an incomplete downgrade.

Go to you database and find core_config_data

Go to triggers and remove ALL triggers.

It relates to the mview module found in Magento enterprise

1
  • I reached out to Enterprise support about this issue. After a week of troubleshooting, they ended up providing a SUPEE SQL patch that rebuilt all Magento triggers. I'm sure this could be extracted, and may have been, directly from Magentos install SQL.
    – TylersSN
    May 16 '16 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.