tracker issue : CF-4204484

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

Alphabetical ordering in query of queries differs from ordering in query from database

| View in Tracker

Status/Resolution/Reason: To Fix//MustFix

Reporter/Name(from Bugbase): Michael C. / ()

Created: 06/08/2019

Components: Database, CFQuery

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016,0,07,311392 /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description:

When a VARCHAR column that has some values which contain all upper case letters is ordered in a QoQ, the ordering differs from that when the query is executed against the database directly.

Steps to Reproduce:
<cfquery name="Test1" datasource="myDSN">
	SELECT * FROM Nations
	ORDER BY NationName
	WHERE NationName IN ('United Kingdom', 'USA')

<cfquery name="Test2" dbtype="query">
	ORDER BY NationName
	WHERE NationName IN ('United Kingdom', 'USA')

<cfdump var="#Test1#">
<cfdump var="#Test2#">
Actual Result:

1. USA
 2. United Kingdom

Expected Result:

1. United Kingdom
 2. USA

Any Workarounds:




Just to note, 'cname' in the second query is a typo, should be 'NationName'.
Comment by Michael C.
30896 | June 10, 2019 04:11:37 PM GMT
Another copy and paste typo, the WHERE clauses should be on line 2, not line 3. It was a long day!
Comment by Michael C.
30897 | June 10, 2019 05:05:35 PM GMT