Search code examples
mysqlerror-handlingx-cart

Xcart error caused by sql syntax


I am running my store under Xcart and I get following error on top of web browser:

INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_MAX_JOIN_SIZE=1073741824' at line 1
SQL QUERY FAILURE:SET OPTION SQL_MAX_JOIN_SIZE=1073741824
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_BIG_SELECTS=1' at line 1
SQL QUERY FAILURE:SET OPTION SQL_BIG_SELECTS=1
INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_BIG_SELECTS=1' at line 1
SQL QUERY FAILURE:SET OPTION SQL_BIG_SELECTS=1

what cause this so I can clear the error?

thanks!


Solution

  • It seems your MySQL server has been updated.

    Replace all strings like 'SET OPTION SQL_MAX_JOIN_SIZE' to these 'SET SESSION MAX_JOIN_SIZE'

    A command for the unix-based hostings

    sed -i 's/SET OPTION /SET SESSION /' $(grep --include='*.php' -rl 'SET OPTION ' ~/www/xcart_4_6_x)