Icon View Incident Report

Serious Serious
Reported By: Dominic Willems
Reported On: 9/4/2002
For: Version 3.15 Build 1
# 1198 Using a Parameter to Compare Against a Constant in an SQL WHERE Clause Can Cause AV

In 3.06 I did get

select distinct Manuf.Name, Manuf.ID
from Manufacturers Manuf, Models
where ((:NoType) or (Models.TypeID=:TypeID))

to work just fine, with Params NoType defined as boolean, and TypeID as integer.

In 3.15 this keeps giving me an AV. Removing the :NoType parameter makes it work.

select Beta.ID
from Beta, Alfa
where  ((:All = TRUE) or (Alfa.ID3 = :ID)) and (Beta.ID=Alfa.ID2)

Changing the :All = TRUE to TRUE = :All is another workaround.

Comments Comments and Workarounds
In above SQL, workaround was to reverse the parameter so that it was on the right-hand side of the binary comparison instead of the left-hand side.

Resolution Resolution
Fixed Problem on 9/5/2002 in version 3.16 build 1