Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)
Created: 03/09/2016
Components: Language
Versions: 2016
Failure Type: Unspecified
Found In Build/Fixed In Build: RC1_v12 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 0
In CF11, queryAddColumn()'s default column type is "object" [aka unspecified] (good)
In CF2016, queryAddColumn()'s default column type is "object" [aka unspecified] if query has no rows (good)
In CF2016, queryAddColumn()'s default column type is "varchar" if query has rows (bad)
Repro:
<cfscript>
q = queryNew("col1");
queryAddColumn(q, "col2", []);//add column when query has 0 rows
queryAddRow(q);
writeDump(getMetadata(q));
querySetCell(q, "col1", {foo="foo"}, 1);
querySetCell(q, "col2", {bar="bar"}, 1);
writeDump(q);
</cfscript>
Actual and expected result in CF11 and CF2016: Both column types are unspecified (aka "object") and the 'foo' and 'bar' structs are inserted into the query.
<cfscript>
q = queryNew("col1");
queryAddRow(q);
queryAddColumn(q, "col2", []);//add column when query already has a row
writeDump(getMetadata(q));
querySetCell(q, "col1", {foo="foo"}, 1);
querySetCell(q, "col2", {bar="bar"}, 1);//throws: Invalid data {BAR={bar}} for CFSQLTYPE CF_SQL_VARCHAR
writeDump(q);
</cfscript>
Actual and expected result in CF11: Both column types are unspecified (aka "object") and the 'foo' and 'bar' structs are inserted into the query.
Actual result in CF2016:
- col1's column type is unspecified (aka "object") (good)
- 'foo' struct is inserted into query (good)
- col2's column type is varchar (bad)
- 'bar' struct throws "Invalid data {BAR={bar}} for CFSQLTYPE CF_SQL_VARCHAR" when inserting into query
Expected result in CF2016: Match CF11
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4126384
External Customer Info:
External Company:
External Customer Name: Aaron Neff
External Customer Email: adobelabs@itisdesign.com
External Test Config:
Attachments:
Comments: