Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
Adam CameronAdam CameronPriority
CriticalFix versions
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
Sprint
NoneAffects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Adam Cameron
Adam CameronPriority
Fix versions
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
Sprint
None
Affects versions
Created 2 May 2017 at 08:32
Updated 7 May 2018 at 15:00
Resolved 7 May 2018 at 15:00
See http://blog.adamcameron.me/2017/04/cfml-lucee-13-v-4-14-v-6-coldfusion-we.html
Query.map
andqueryMap
take a parameter of type query which specifies the definition of the query that should be returned. This is not uses properly in two ways, as demonstrated by this test case:describe("map tests", function(){ var numbers = duplicate(baseNumbers); var remapTemplate = queryNew("value,english,maori"); var reMapped = numbers.map(function(row){ return {value=row.id, english=row.en, maori=row.mi}; }, remapTemplate); it("does a basic remapping", function(){ var queryWithDifferentColumns = queryNew("value,english,maori", "integer,varchar,varchar", [ [1,"one","tahi"], [2,"two","rua"], [3,"three","toru"], [4,"four","wha"] ]); expect(reMapped).toBe(queryWithDifferentColumns); }); it("does not mess with the remapTemplate", function(){ expect(remapTemplate).toBe(queryNew("value,english,maori")); }); });
Both of these fail:
the columns from
queryWithDifferentColumns
should be the only columns in the resultant query. however these columns are just added to the original querythe
queryWithDifferentColumns
should not change: it's just a template. However it seems this is replaced by the remapped query.Contrast this with CF on which both tests pass.