Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.1.4.18
    • Fix Version/s: 5.2.8.23
    • Labels:
      None
    • Sprint:
      May 2018 Sprint

      Description

      See http://blog.adamcameron.me/2017/04/cfml-lucee-13-v-4-14-v-6-coldfusion-we.html

      Query.map and queryMap 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 query
      • the 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.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              da_cameron Adam Cameron
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: