这在ColdFusion 11中不会崩溃,但会在ColdFusion 2016中崩溃
SELECT *
FROM dbo.Roles WITH (NOLOCK)
WHERE Code IS NOT NULL
AND Active = 1
AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees
这两种方法都可以正常使用
SELECT *
FROM dbo.Roles WITH (NOLOCK)
WHERE Code IS NOT NULL
AND Active = 1
AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK))
是否有恢复原始行为的设置?
更新
我认为我有一个最小的问题例子,但我没有。这是完整的查询
SELECT '<ul>' + STUFF (
(
SELECT MIN(Role) AS "li/code", Code AS "li/span/b", 'Unsorted' AS "li/span/var"
FROM dbo.Roles WITH (NOLOCK)
WHERE Code IS NOT NULL
AND Active = 1
AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees
GROUP BY Code
FOR XML PATH ('')
),
1,0,''
) + '</ul>' AS xmlRole
当我打开数据库调试时:我得到:
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> OK
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> Statement[4].execute(String sql, int autoGeneratedKeys)
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> sql = SELECT '<ul>' + STUFF ( ( SELECT MIN(Role) AS "li/code", Code AS "li/span/b", 'Unsorted' AS "li/span/var" FROM dbo.Roles WITH (NOLOCK) WHERE Code IS NOT NULL AND Active = 1 AND RoleID IN (SELECT RoleID FROM dbo.Emp WITH (NOLOCK)) -- It's ok to look at termed employees GROUP BY Code FOR XML PATH ('') ), 1,0,'' ) + '</ul>' AS xmlRole
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>> autoGeneratedKeys = 1
spy(http-nio-8500-exec-5)(2016/02/17 10:21:13.807)>>
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ')'. ErrorCode=102 SQLState=HY000
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near ')'.
at macromedia.jdbc.sqlserverbase.ddcw.b(Unknown Source)
at macromedia.jdbc.sqlserverbase.ddcw.a(Unknown Source)
请注意,SQL String位于一行上。评论开始时,它不会结束。 --
之后的所有内容仍然是注释掉的。
启用了空白区域管理。关闭它不会改变行为。生成的SQL是相同的
答案 0 :(得分:1)
据Adobe称,添加Update 1将解决此问题
更新1中修补的问题列表: https://helpx.adobe.com/coldfusion/kb/bugs-fixed-coldfusion-2016-update-1.html#main-pars_minitoc
更新1的详情: https://helpx.adobe.com/coldfusion/kb/coldfusion-2016-update-1.html