Title:
[ANeff] Bug for: queryAddColumn() casts to bit if preceeded by bit column and QoQ had a prefixed ORDER BY
| View in TrackerStatus/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
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:
A|B|C|D
-----------
0|2|0|2
Actual Result:
A|B|C|D
-----------
0|2|0|1
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:
Attachments:
Comments: