tracker issue : CF-3525456

select a category, or use search below
(searches all categories and all time range)
Title:

Use of tabs within HQL SELECT throws error

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Matthew Walker / Matthew Walker (leptinella1)

Created: 03/19/2013

Components: ORM Support

Versions: 10.0

Failure Type: Usability Issue

Found In Build/Fixed In Build: Final / CF10_Update14

Priority/Frequency: Minor / Some users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 2

Problem Description:
If you use tabs to lay out your HQL query without spaces then you receive a cryptic error. 

Steps to Reproduce:
Here's a typical query. If the white space is done with tabs then there is an error. If it is a combination of spaces and tabs or just spaces it works. 
<cfquery name="tags" dbtype="hql">
	SELECT		tag.tag
	FROM		thrive.tag tag
	WHERE		tag.tag LIKE <cfqueryparam value="#url.q#%">
	ORDER BY	tag.objects.size desc
</cfquery>

Actual Result:
org.hibernate.hql.QueryExecutionRequestException: Not supported for select queries [
 SELECT	 tag.tag
 FROM thrive.tag tag
 WHERE tag.tag LIKE ?
 ORDER BY tag.objects.size desc
 ]

Any Workarounds:
This error is easy to work around. However, the error message is completely misleading so it is tricky to debug and just one more horrible ORM / CF experience. This has been reported before. I think it would be great to either fix this (just turn tabs into spaces?) or at least fix the error messaging.
https://bugbase.adobe.com/index.cfm?event=bug&id=3041019

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3525456

External Customer Info:
External Company:  
External Customer Name: leptinella1
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

This has been logged previously as https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3041019 (closed as "not a bug", believe it or not), and then again as https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3043823 (closed as "not enough time"). It's still a bug, and it would be nice if Adobe can find time to fix it.
Comment by External U.
15957 | March 21, 2013 02:07:44 AM GMT
This is still as much of a bug as it was when it was first raised three years ago. And still needs fixing. -- Adam
Vote by External U.
15963 | March 21, 2013 02:08:22 AM GMT
I have CF 10,0,13,287689 -- should this be fixed for me? Because it's not. It sure would be nice to be able to use whatever kind of whitespace I like in my HQL queries.
Comment by External U.
15958 | August 22, 2014 11:00:33 AM GMT
Here's a repro case: https://gist.github.com/atuttle/e2ccaa61c243df393b54
Comment by External U.
15959 | August 22, 2014 11:45:40 AM GMT
I have verified this is fixed on CF11, but not on CF10. Needs to be reopened and refixed on CF10 as well. Pls. -- Adam
Comment by External U.
15960 | August 22, 2014 12:15:51 PM GMT
As per my comments, this is still broken on CF10. This is my vote for back-porting the fix to CF10, too.
Vote by External U.
15964 | August 22, 2014 12:22:35 PM GMT
Adobe, hello?
Comment by External U.
15961 | September 24, 2014 02:07:55 AM GMT
This was fixed in ColdFusion 10, update 14.
Comment by Rupesh K.
15962 | December 10, 2015 11:11:00 PM GMT