Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[HY000]: General error: 1105 command *sqlparser.Set not supported now #625

Closed
ucwords opened this issue Feb 23, 2023 · 1 comment

Comments

@ucwords
Copy link

ucwords commented Feb 23, 2023

使用hperf 查询构造使用时候出现这种情况。

版本:kingshard1.6
PDO:
PDO::ATTR_EMULATE_PREPARES=false
PDO::ATTR_STRINGIFY_FETCHES => false
SQL:
select product_name as product_name, sum(if(cid_contact_id not in (3254,3256,3260,3262,3264,3266,3268), cost, 0)) as cost, sum(if(cid_contact_id in (3254,3256,3260,3262,3264,3266,3268), cost, 0)) as rebate_cost, sum(new_login_count) as new_login_count, null as login_unit_price, null as payment_rate, null as pay_unit_price, null as until_roi, sum(new_pay_people) as new_pay_people, sum(new_pay_sum_divide) as new_pay_sum_divide, null as until_profit from yd_super_report.data_report_day_cid where recdate >= '2023-02-01' and recdate <= '2023-02-28' group by product_name)

@ucwords
Copy link
Author

ucwords commented Feb 23, 2023

知道问题了,
用的为非原生 MySQL 或云厂商提供的 DB 如从库/分析型实例等不支持 MySQL prepare 协议的需要将 PDO::ATTR_EMULATE_PREPARES 设置为 true。

@ucwords ucwords closed this as completed Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant