SQLSTATE[HY000]: General error: 1105 command *sqlparser.Set not supported now
ucwords opened this issue · 1 comments
使用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
)
知道问题了,
用的为非原生 MySQL 或云厂商提供的 DB 如从库/分析型实例等不支持 MySQL prepare 协议的需要将 PDO::ATTR_EMULATE_PREPARES 设置为 true。