tracker issue : CF-4206471

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

Misleading ColdFusion QueryAddColumn Error Message

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): James M. / ()

Created: 01/03/2020

Components: Language, Tags

Versions: 2016

Failure Type: Conflict With Docs

Found In Build/Fixed In Build: 2016,0,13,316217 /

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Win 2008 Web Server

Vote Count: 0

Problem Description:
When using QueryAddColumn and omitting the 4th parameter, the error message is regarding the 3rd parameter and incorrectly declares it to be an invalid  interface java.util.List value.

Steps to Reproduce:
I blogged about it here:
https://dev.to/gamesover/misleading-coldfusion-queryaddcolumn-error-message-1lih

This code will throw an error in CF2016 & 2018.
<cfset myQuery = QueryNew("id", "int")>
<cfset QueryAddColumn(myQuery, "Name", "varchar")>

Actual Result:
The value of parameter 3, which is currently varchar, must be a interface java.util.List value.

Expected Result:
Maybe something meaningful like "The value of parameter 4 is missing, must be an array value."

Any Workarounds:
Ignore the server error message and review QueryAddColumn in the documentation to determine that the 4th parameter is required even if it's an empty array added to an empty query.  CFDocs states that it's "required".

Attachments:

Comments: