QoQ and QuerySort don't sort varchar columns correctly

Description

When sorting a query varchar column, the sort is implemented inconsistently. For example if I have a query with a 'name' column and I have the following two values in it:

  • Copay Plan With Wellness

  • Copay Plan Without Wellness

If I sort 'asc', the 'Copay Plan Without Wellness' appears before the 'Copay Plan With Wellness'. The incorrect sorting happens when doing this:

q = queryExecute("SELECT name FROM q ORDER BY name", {}, {dbType: "query"});

or using the querySort functionality like so:

querySort(q, 'name', 'asc')

You can see the cf-gist here:

https://trycf.com/gist/3f3ce789c5f8a7ac81d23561108b77e3/lucee5?theme=monokai

Environment

Windows 2016

Status

Assignee

Michael Offner

Reporter

brett deline

Labels

None

Affects versions

5.2.9.38

Priority

New
Configure