Icon View Incident Report

Serious Serious
Reported By: Trevor Keegan
Reported On: 5/30/2001
For: Version 2.09 Build 1
# 794 Possible AV in SQL with Multiple Expressions in WHERE or JOIN Clauses

I am having a problem converting one of my applications to v2.09 from v2.08 in BCB 4.0. My problem is that two of my queries are generating access violations even in the designer, where they worked fine before under v2.08. The message is

Access violation at address 03149805 in module DB209C4R.BPL. Read of Address
FFFFFFFF.

I also get this message during runtime, there the panel works fine the first time, then subsequently fails with Access Violation.

My queries are defined pretty much as static SQLs and are used as a find criteria, they are as follows:

SELECT Sales.OID,
               Sales.Number,
               Sales."Date"
FROM Sales,
            Dealer,
            cfgCompany,
            cfgSalesStatus
WHERE Sales.DealerID = Dealer.OID AND
               Sales.CompanyID = cfgCompany.OID AND
               Sales.StatusID = cfgSalesStatus.OID AND
               (Sales.Number =  :SalesNumber OR (0 = :SalesNumber AND
Sales.Number >= 0)) AND
               Dealer.Name LIKE :DealerName AND
              cfgCompany.Description LIKE :CompanyName AND
              cfgSalesStatus.Description LIKE :SalesStatus
ORDER BY Sales.Number DESC

:SalesNumber is an Integer
and the other parameters are Strings

And

SELECT Warranty.OID,
               Warranty.Number,
               SalesLineSerialNumber.SerialNumber
FROM Warranty,
            SalesLineSerialNumber,
            cfgCompany,
            cfgWarrantyStatus
WHERE
               Warranty.CompanyID = cfgCompany.OID AND
               Warranty.StatusID = cfgWarrantyStatus.OID AND
               Warranty.SalesLineSerialNumberID = SalesLineSerialNumber.OID
AND
               (Warranty.Number =  :WarrantyNumber OR (0 = :WarrantyNumber
AND Warranty.Number >= 0)) AND
               SalesLineSerialNumber.SerialNumber LIKE :SerialNumber  AND
              cfgCompany.Description LIKE :CompanyName AND
              cfgWarrantyStatus.Description LIKE :WarrantyStatus
ORDER BY Warranty.Number DESC

:WarrantyNumber is an integer
All other parameters are strings



Comments Comments
This was a problem in the expression token handling at a pretty low level in the engine. As a result, this bug could affect filters, locates (which sometimes use filters to search), finds, and SQL queries. It is recommended that anyone using any of these features upgrade to 2.10 immediately.


Resolution Resolution
Fixed Problem on 6/2/2001 in version 2.10 build 1
Image