tracker issue : CF-3925839

select a category, or use search below
(searches all categories and all time range)
Title:

Columns added w/ QueryAddColumn w/o a datatype specified that have at least one value in the column fail during a for-in loop

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): James Harris / James Harris (James Harris)

Created: 01/22/2015

Components: Core Runtime

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final / 313169

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Win 2008 Server R2 64 bit

Vote Count: 2

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 06, 2017 using build 2016.0.01.298513
Problem Description: Columns added via QueryAddColumn without a datatype specified that have at least one value in the column fail during a for...in loop

Steps to Reproduce: Run the code in the attached file to see the error.

Actual Result: java.lang.ArrayIndexOutOfBoundsException

Expected Result: No exception

Any Workarounds:
1) Specify a data type for the new column in the QueryAddColumn call
2) Change your looping method to while(query.next()) {}

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3925839

External Customer Info:
External Company:  
External Customer Name: James
External Customer Email:  
External Test Config: My Hardware and Environment details: Windows Server 2008R2 x64, CF11 Update 3

Attachments:

  1. January 23, 2015 00:00:00: 1_breakQueryForIn.cfm

Comments:

+1 ......................
Vote by External U.
8869 | January 29, 2015 02:32:53 AM GMT
Verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
8866 | August 06, 2017 12:10:34 AM GMT
This is broken again on ColdFusion 11 Update 13. It can be seen on try.cfm as functional on every engine but ColdFusion 11. Do you guys have regression test suites for these? Here is another example: <cfscript> info = QueryNew("Toast","varchar",["milk"]); queryAddColumn( info, "size" ,[1]); for( i = 1; i <= info.recordCount; i++ ){ querySetCell( info, "size", 0, i ); } for(vendor in info){ } </cfscript>
Comment by Justin T.
8867 | March 21, 2018 08:09:16 PM GMT
@Aaron Am I reading this correctly that this was only fixed in CF2016?
Comment by Justin T.
8868 | March 22, 2018 11:36:17 AM GMT
Hi Justin, I'd only verified this on CF2016. I'd reach out to cf.install@adobe.com for clarification regarding CF11. Thanks!, -Aaron
Comment by Aaron N.
26401 | March 28, 2018 08:16:03 AM GMT
Hi Adobe, If you see this, could you perhaps add a comment indicating if this was fixed or not in CF11? If only that FixedInBuild field was always used =P Thanks!, -Aaron
Comment by Aaron N.
26402 | March 28, 2018 08:17:02 AM GMT
Hi Adobe, Please disregard. I see this comment in Slack: "The fix for CF 11 would get included in the next update for CF 11, i.e, Update 14, which is due in April." Thanks!, -Aaron
Comment by Aaron N.
26403 | March 28, 2018 08:22:19 AM GMT
It was not included.
Comment by Justin T.
27929 | May 23, 2018 06:35:28 PM GMT