Query Group Output Issue

Description

Please run this very simple code:

<cfset myQuery=QueryNew("artNr") />
<cfset QueryAddRow(myQuery,2) />
<cfset QuerySetCell(myQuery,"artNr","013",1) />
<cfset QuerySetCell(myQuery,"artNr","0013",2) />

<cfdump var="#myQuery#">

<cfoutput query="myQuery" group="artNr">
#artNr#<br />
</cfoutput>

There are two records inserted; one with artNr "013" and one with "0013". If you output them grouped by "artNr", only the first one is shown. Actually, they are different and both should be shown. Works with ACF, but not with Lucee...

Environment

None

Attachments

2
  • 11 Apr 2018, 03:41 pm
  • 11 Apr 2018, 03:41 pm

Activity

Show:

Jürg Anderegg 12 April 2018 at 06:19

Actually, I've simplified my example from a real world example where data is been fetched from a MSSQL Database. Therefore, I think the problem is not QuerySetCell, but somewhere within the cfoutput and group. Please also note previous comment - grouping works if I append "groupcasesensitive=yes" (which should be default as mentioned in the docs)

Pothys - MitrahSoft 11 April 2018 at 15:43

I've added test case for this ticket & confirmed the issue happened on lucee. I think the problem with insertion while insert using QueryNew(), Lucee & ACF truncates a leading zeros & saved the data. While using querysetcell(), lucee truncates leading zeros & saved data but ACF saves with leading zero. I don't know which one is correct. Anyway will confirm about this

Result:

ACF insertion
Lucee insertion

Pull Request: https://github.com/lucee/Lucee/pull/443

Jürg Anderegg 11 April 2018 at 08:04

Just noticed - with groupcasesensitive="YES" in the cfoutput section, the grouping works. According to the docs http://docs.lucee.org/reference/tags/output.html, the attribute "groupcasesensitive" shoud actually be defaultet to "YES"... Strange anyway, because the leading zero shouldn't be related to "casesensitive"?

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 10 April 2018 at 12:17
Updated 2 March 2021 at 11:20

Flag notifications