tracker issue : CF-4198283

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

Division by zero in a QoQ returns 1.#INF

| View in Tracker

Status/Resolution/Reason: Needs Review//Investigate

Reporter/Name(from Bugbase): Michael Clark / Michael Clark ()

Created: 01/24/2017

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

Versions: 2016,11.0

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: CF11 Update 10 /

Priority/Frequency: Normal / All users will encounter

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

Vote Count: 0

Problem Description:
 I believe there are actually two bugs here:

1. When division by zero is encountered in a query-of-query, a value of

\{numerator}

.#INF is returned, rather than throwing a division by zero error like all DBMSs do.

2. When passing this returned value to the NumberFormat function, it formats the word 'Infinity' with the mask.

Steps to Reproduce:
 Execute the following code:

 
{code}
<cfquery datasource="MyDSN" name="Test">
 SELECT 1 AS Value1, 0 AS Value2
 </cfquery>
<cfquery name="Test2" dbtype="query">
 SELECT Value1 / Value2 AS Value3
 FROM Test
 </cfquery>
<cfdump var="#Test2#" />
<cfoutput>#NumberFormat(Test2.Value3, "9.99")#</cfoutput>
{code}
 

Actual Result:
 1. The value of Test2.Value3 is shown as 1.#INF when dumping the query.
 2. The output of the NumberFormat function is Infinity.00

Expected Result:
 The QoQ should throw a division by zero error.

Any Workarounds:
 None.

Attachments:

Comments:

Any update on this?
Comment by Michael C.
30377 | February 22, 2019 05:14:44 PM GMT