tracker issue : CF-4159130

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

querySetCell wont take a struct as data

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Dave Ferguson / Dave Ferguson (Dave Ferguson)

Created: 05/30/2016

Components: Language

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF2016_Final /

Priority/Frequency: Normal / Some users will encounter

Locale/System: ALL / Platforms All

Vote Count: 0

I discovered this when porting my blog (running blogcfc) from CF9 to CF2016.  

In blog.cfc in blogcfc around line 1534 there is this line of code that worked fine in CF9

<cfset querySetCell(getEm,"categories", catData, currentRow)>

The var "catData" is a struct set earlier.  In CF 9 this was perfectly acceptable and when eventually dumping the "getem" query you can actually see the struct in the cell.

In CF 2016 this same code throws this error:

invalid data {5E684C7C-028C-BEB4-E67E4E7DC72E8AAD={CF2016},5E978CDE-0CF1-148F-39EAA5AF37E00DED={API Manager}} for CFSQLTYPE CF_SQL_VARCHAR.

It would appear that CF is trying to convert the struct to json but it is failing along the way somewhere.

To fix the code I had to change that previously mentioned line to:  

<cfset querySetCell(getEm,"categories",SerializeJSON(catData),currentRow)>

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

Watson Bug ID:	4159130

External Customer Info:
External Company:  
External Customer Name: Dave Ferguson
External Customer Email:  
External Test Config: My Hardware and Environment details:



HI Dave , I tried the following code on 9.0.2 , 10.0,11.0 & 2016 . <cfset myQuery = QueryNew("Name","Varchar")> <cfset mystruct={ "5E684C7C-028C-BEB4-E67E4E7DC72E8AAD"="{CF2016}", "5E978CDE-0CF1-148F-39EAA5AF37E00DED"="{API Manager}" }> <!--- Make two rows in the query ---> <cfset QueryAddRow(MyQuery, 2)> <!--- Set the values of the cells in the query ---> <cfset QuerySetCell(myQuery, "Name", mystruct, 1)> I get the same error on all versions mentioned above. Please attach a repro code , if there is some regression ! We would fix ,if there is a regression caused! Thanks, Suchika.
Comment by Suchika S.
2592 | June 02, 2016 02:24:47 AM GMT
This is what is happening in blogcfc... <cfset catData = structNew()> <cfloop query="getCategories"> <cfset catData[categoryID] = categoryName> </cfloop> <cfset querySetCell(getEm,"categories",catData,currentRow)>
Comment by External U.
2593 | June 02, 2016 09:10:20 AM GMT
Dave, what version of 9 was blogCFC running on? We tried the sample of and get the same error.
Comment by Vamseekrishna N.
2594 | August 03, 2016 04:42:10 AM GMT
Dave, would help if you can share an update here.
Comment by Vamseekrishna N.
2595 | August 18, 2016 01:44:38 AM GMT
@Dave - We are closing this bug for now as we are to able to see the same behavior. In case you have additional information for us, let us know and we can reopen this bug.
Comment by Vamseekrishna N.
2596 | August 24, 2016 12:16:29 AM GMT