ColdFusion 2016: Comments in SQL statements crash query

Adobe has released ColdFusion 2016 Final some time ago. Well we took some time to give it a try and since 3 days we do not have so much fun.

The most heavy bug I can share is that CF 2016 is failing to execute SQL statements that has comments inside. This happens only with -- comments. I'm not sure if this is limited to Microsoft SQL. It has for sure nothing to do with the Microsoft JDBC driver you are using. See Adobe bugtracker ColdFusion 2016 - Bug 4126398: SQL comments inside CFQuery are not ignored.

Broken:

-- Using a comment after the code on a line.
USE Northwind
GO
UPDATE Products
SET UnitPrice = UnitPrice * .9 -- Try to build market share.
GO

Workaround:

USE Northwind
GO
SELECT * FROM Employees
/* The
GO in this comment causes it to be broken in half */
SELECT * FROM Products
GO

Solution: You can change all your code... (just kidding) or ask support. They have a hotfix with file name chf20160001.jar that works and will be integrated in Updater 1.

  • 11.06.2016: Fixed in ColdFusion 2016 Updater 1
  • 03.05.2016: Documented bug to public
Rating
Average: 7.8 (4 votes)