manticorp / SphinxSearch

Manticorp_SphinxSearch for Magento
15 stars 9 forks source link

User Error: DDL statements are not allowed in transactions in ./lib/Varien/Db/Adapter/Pdo/Mysql.php #4

Closed doctea closed 8 years ago

doctea commented 8 years ago

I'm getting lots of these errors in my log files. This seems to be because table operations aren't allowed inside transactions. Is there a fix or workaround for this at all?

The SQL statements that trigger the error are: DROP TABLE IF EXISTSmagento_sphinx_catalogsearch_fulltext_tmp`;

CREATE TABLE magento_sphinx_catalogsearch_fulltext_tmp LIKE magento_sphinx_catalogsearch_fulltext;

DROP TABLE IF EXISTS magento_sphinx_catalogsearch_fulltext_prev

RENAME TABLE magento_sphinx_catalogsearch_fulltext TO magento_sphinx_catalogsearch_fulltext_prev,magento_sphinx_catalogsearch_fulltext_tmp TO magento_sphinx_catalogsearch_fulltext

DROP TABLE IF EXISTS magento_sphinx_catalogsearch_fulltext_prev

TRUNCATE TABLE `magento_catalogsearch_result``

manticorp commented 8 years ago

Hmm...I've not seen this error before, but the problem code should be in:

https://github.com/manticorp/SphinxSearch/blob/master/app/code/community/Manticorp/SphinxSearch/Model/Resource/Fulltext/Engine.php

If you find a fix, let me know! I don't use magento at the moment so I've nothing to try it out on :)

doctea commented 8 years ago

Thanks for your swift reply, @manticorp !

I've just looked into the code, and found places in Manticorp_SphinxSearch where direct SQL queries can be turned into Varian PDO Adapter calls.

I've not been able to test if the functionality continues to work correctly, but the errors are not showing in my log files any more. I've submitted a pull request #5 with the changes I've made.

Thanks for the module and your help!

manticorp commented 8 years ago

No problem - will merge the pull request now

manticorp commented 8 years ago

5