Icon View Incident Report

Serious Serious
Reported By: Suat Hakki
Reported On: 10/2/2013
For: Version 4.36 Build 3
# 3906 TOP Used with ORDER BY Expressions from Non-Driver Table Can Cause Incorrect Results

There is as critical bug in DBISAM 4.36 build 3 (also in some earlier versions). See below.

select a.SONG_ID, a.SONG_NAME, b.ARTIST_NAME
from ARTISTS b, SONGS a
where b.ARTIST_ID=a.ARTIST_ID 
and a.SONG_ID>=495  
and a.SONG_ID<996 
order by a.SONG_ID 
top 2 

returns incorrect set (retrieves records with SongId 713, 714)

select a.SONG_ID, a.SONG_NAME, b.ARTIST_NAME 
from ARTISTS b, SONGS a 
where b.ARTIST_ID=a.ARTIST_ID 
and a.SONG_ID>=495  
and a.SONG_ID<996 
order by a.SONG_ID 
top 2 

returns correct set (retrieves records with SongId 495, 496)



Comments Comments
The bug was in the TOP functionality combined with the ORDER BY when the ordering expression was not from the first table in the FROM clause.


Resolution Resolution
Fixed Problem on 10/3/2013 in version 4.37 build 1


Products Affected Products Affected
DBISAM Additional Software and Utilities
DBISAM ODBC Client-Server
DBISAM ODBC Client-Server with Source
DBISAM ODBC Standard
DBISAM ODBC Standard with Source
DBISAM ODBC Trial
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image