我最近将一个应用程序从 cf9 移动到 cf10
运行设置了 maxrows 的查询时,我收到以下错误:
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_SELECT_LIMIT=1000' at line 1
该查询在 cf9 和 cf8 上运行良好。
玩了一下,看起来 cf10 正在查询前面,OPTION SQL_SELECT_LIMIT=1000;
但 mySQL 无法识别它。如果我从查询中取出 maxrows 设置,它运行良好。
另外值得注意的是,该查询有两个外连接。
其他人在迁移到 cf10 时遇到过类似的问题吗?
提前感谢您的任何建议
这是完整的查询
<cfquery name="details" datasource="#Application.ds#" maxrows="#arguments.maxrows#">
SELECT b.booking_id,
DATEDIFF(b.check_out,b.check_in) as nights,
b.package_id,
b.beds_cot,
b.date_booked,
b.beds_king,
b.status,
b.tstamp as booking_tstamp,
g.ext_ref_id as guest_ext_ref_id,
g.title,
g.first_name,
g.surname,
g.full_name,
g.tstamp as guest_tstamp,
r.room_id,
r.ext_ref_id as room_ext_ref_id,
r.name as room_name,
r.description as room_description,
p.package_id,
p.ext_ref_id as package_ext_ref_id,
p.name as package_name,
p.description as package_description,
p.date_start as pacakge_date_start,
p.date_end as package_date_end
FROM guest_booking as b
JOIN guest as g
LEFT JOIN room as r ON b.room_id = r.room_id
LEFT JOIN packages as p on b.package_id = p.package_id
WHERE b.provider_id = #arguments.provider_id#
and b.guest_id = g.guest_id
<cfif isdefined("arguments.status")>
and b.status = #arguments.status#
</cfif>
<cfif isdefined("arguments.booking_id")>
and b.booking_id = #arguments.booking_id#
</cfif>
ORDER BY #arguments.order_by#
</cfquery>