tracker issue : CF-3740190

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

[ANeff] Bug for: queryAddColumn() casts to bit if preceeded by bit column and QoQ had a prefixed ORDER BY

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 04/10/2014

Components: Database, Query-of-Query(IMQ)

Versions: 11.0

Failure Type: Data Corruption

Found In Build/Fixed In Build: PublicBeta /

Priority/Frequency: Critical / Some users will encounter

Locale/System: English / Win All

Vote Count: 1

Listed in the version Issues Fixed doc
queryAddColumn() casts to bit if previous queryAddColumn() was bit and if appending to a QoQ-created query that used a prefixed ORDER BY

Steps to reproduce:

<cfset q1 = queryNew("") />
<cfset queryAddColumn(q1, "a", "bit", [0]) />
<cfset queryAddColumn(q1, "b", "integer", [2]) />
<cfquery name="q2" dbtype="query">SELECT a,b FROM q1 ORDER BY q1.a</cfquery><!--- cause: 'ORDER BY q1.' --->
<cfset queryAddColumn(q2, "c", "bit", [0]) />
<cfset queryAddColumn(q2, "d", "integer", [2]) /><!--- effect: integer 2 is cast to boolean 1 --->
<cfdump var="#q2#" abort="true" />

Expected Result:


Actual Result:


The issue is column D.  It was defined as integer and populated w/ 2.  But the result query has 1, b/c the "ORDER BY q1." in the QoQ triggered the D column to be created as bit.

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

Watson Bug ID:	3740190

External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:



Related thread:
Comment by External U.
12729 | April 10, 2014 01:58:44 AM GMT
+1 / subscribe -- Adam
Vote by External U.
12732 | April 10, 2014 03:18:20 AM GMT
This issue is fixed and this fix will be available in the upcoming update of ColdFusion 11.
Comment by Nimit S.
12730 | August 22, 2014 09:53:05 AM GMT
Hi Nimit, I've verified this is fixed in CF11 Update 3. Thanks!, -Aaron
Comment by External U.
12731 | November 02, 2014 10:00:02 PM GMT