Skip to content

Commit

Permalink
Added a test case and fix for LDEV-2637 (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmitrah authored Apr 1, 2021
1 parent d74bcfb commit ccba67f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static boolean call(PageContext pc, Query query, String columnName, Objec

public static boolean call(PageContext pc, Query query, String columnName, Object value, double rowNumber) throws PageException {
if (rowNumber == -9999) rowNumber = query.getRecordcount();// used for named arguments
query.setAt(KeyImpl.init(columnName), (int) rowNumber, value);
query.setAt(KeyImpl.init(columnName.trim()), (int) rowNumber, value);
return true;
}

Expand Down
19 changes: 19 additions & 0 deletions test/tickets/LDEV2637.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
component extends="org.lucee.cfml.test.LuceeTestCase" {

function run( testResults , testBox ) {
myQuery = QueryNew("myCol1, myCol2,myCol3", "varchar,varchar,varchar");
QueryAddRow(myQuery, 1);

describe( "test suite for LDEV2637", function() {
it(title = "QuerySetCell column name without spaces", body = function( currentSpec ) {
QuerySetCell(myQuery,"myCol2","Lucee", 1);
expect("Lucee").toBe(myQuery.myCol2);
});

it(title = "QuerySetCell column name with spaces", body = function( currentSpec ) {
QuerySetCell(myQuery," myCol2","Lucee", 1);
expect("Lucee").toBe(myQuery.myCol2);
});
});
}
}

0 comments on commit ccba67f

Please sign in to comment.