Our instance is throwing an error on this cronjob
PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ''
The code is pulling empty table name. It seems the reason is because in the function Enterprise_Index_Model_Cron::_runCleanupAction()
is this code:
$this->_getClient()->init($metadata->getTableName());
which passes the correct table names as they are in the database (with prefix "mage_"), but then in the underlying method Enterprise_Mview_Model_Client::init($name)
it does this...
public function init($name)
{
$tableName = $this->_factory->getSingleton('core/resource')->getTableName($name);
$this->_metadata = $this->_factory->getModel('enterprise_mview/metadata')
->load($tableName, 'table_name');
if (!$this->_metadata->getId()) {
$this->_metadata->setTableName($tableName);
}
return $this;
}
It gets a new table name using
$tableName = $this->_factory->getSingleton('core/resource')->getTableName($name);
which returns the same table name string only with a duplicated prefix e.g. "mage_mage_enterprise_url_rewrite_redirect". The code then cannot instantiate the model afterwards on this faulty table name.. This seems like a Magento core issue, no? Has Magento addressed this, or what would be the proper way to resolve this?