由sql语法引起的Xcart错误

时间:2016-11-17 22:02:13

标签: mysql error-handling x-cart

我在Xcart下运行我的商店,我在网络浏览器上遇到以下错误:

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

是什么导致这样我可以清除错误?

谢谢!

2 个答案:

答案 0 :(得分:2)

您的MySQL服务器似乎已更新。

替换所有字符串 'SET OPTION SQL_MAX_JOIN_SIZE' 对这些 'SET SESSION MAX_JOIN_SIZE'

基于unix的主机的命令

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

答案 1 :(得分:0)

需要检查执行此查询的xcart php脚本,并将OPTION替换为SESSION以查找错误,例如

  

SQL QUERY FAILURE:SET OPTION SQL_BIG_SELECTS = 1

另外,至于

  

SQL QUERY FAILURE:SET OPTION SQL_MAX_JOIN_SIZE = 1073741824

将其更改为db_query("SET max_join_size=1073741824");

可能值得

它适用于某些xcart安装,所以请报告它是否对您的项目有帮助,谢谢