Icon View Incident Report

Minor Minor
Reported By: Terry Swiers
Reported On: 9/22/2013
For: Version 2.13 Build 3
# 3898 Aggregate Functions Impoperly Allowed in SELECT Sub-Query WHERE Clause and Causes AV

The following SQL produces an AV in both local and remote connections in the attached database. It DOES produce an empty result set without the AV if all of the tables are empty.

I'm not sure that this is even valid SQL (I didn't write it) with the Min() call in the table joins of a sub-select, but thought you would like to know about the AV.

Select p.StockCode, Min(p.RecDate), Min(p.PreOnHand), Sum(p.Received),
Select if(Sum(ii.Quantity) is Null then 0 else Sum(ii.Quantity))
From invitem ii join invoice i on i.Number = ii.Number
Where ii.StockCode = p.StockCode and i.TransDate >= Min(p.RecDate)
From porcv p
Group By p.StockCode



Comments Comments and Workarounds
The workaround is "don't do that".


Resolution Resolution
Fixed Problem on 9/26/2013 in version 2.14 build 1


Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image