To enable PDO MySQL Debug need to edit this file: /lib/Varien/Db/Adapter/Pdo/Mysql.php
protected $_debug = true;
then we open this file: /lib/Zend/Db/Statement/Pdo.php, and replace this line about 234:
throw new Zend_Db_Statement_Exception($e->getMessage(), (int) $e->getCode(), $e);
with this code:
$msg = "SQL ERROR: ". $e->getMessage() . "\n";
$msg .= "SQL QUERY:" . $this->_stmt->queryString."\n";
if(!empty($params)) {
$msg .= "SQL PARAMS: ('". implode("','", $params) ."')\n";
}
$dbsEx = new Zend_Db_Statement_Exception($msg, (int) $e->getCode(), $e);
throw $dbsEx;
so now we will get a folder /var/debug/, and file pdo_mysql.log in this file we have now full mysql error with full mysql query. you can easily execute those failing queries in phpmyadmin or edit database table, params, etc.
im happy with it.