Frank, I have fix bug in indexes!

Olivier vidal_olivier at yahoo.fr
Fri Jan 28 06:32:18 CST 2005


Hi Ruslan and list,


>     Oliver with report on wrong BinaryLink results
>

There is always a problem.

First, I had difficulties to reproduce the problem with b38.
But I isolated the problem and it reproduces with b39.

I send you (to ruslan) thus a small project where always reproduces the 
problem.

We thus have two tables :

ZipCity table
Street table

Both tables are linked by a binary link:
LinkCityStreet=new vbinaryLink (" linkCityStreet ", zipCity, street, 
EVLinkType.kOne, EvLinkType.kmany)

- > launch the project

- > click on " create DB ": WAIT for some minutes which the DB builds 
up itself:

40 002 citys create
100 000 streets create
   For i=1 to 30000
     Base.linkCityStreet.linkRecords (array (1, i)) // 30 000 streets 
linked with the city "1" which along Zipcode = '75000'
   Next i
   For i=30001 to 30002
     Base.linkCityStreet.linkRecords (array (2, i)) // 2 streets linked 
with the city "2" which along Zipcode ALSO = '75000'
   Next i

- > click " SQL Start ":
Cur=new vcursor (base, " SELECT * FROM zipcity join street we 
linkcitystreet where zipcode = '75000' ", evCursorLocation.kServerSide, 
evLockType.kReadOnly, evCursorDirection.kRandom)

- > result: 30 002 found records, OK ! TRUE

- > quit the project

- > restart the project

- > click on " OPEN DB " (NOT "create DB", click "Open DB" button)

- > click " SQL Start "

- > result: only 2 records found! FALSE

- > click again one " SQL Start "

- > result: 30 002 founds records! TRUE

Thus, in the first opening of the DB, on the first SQL query, the 
result is false.

NOW, quit app, and in "PushButton2.action" (" create DB " button), you 
change the following lines:

   For i=1 to 30000
     Base.linkCityStreet.linkRecords (array (1, i))
   Next i
   For i=30001 to 30002
     Base.linkCityStreet.linkRecords (array (2, i))
   Next i

BY

   For i=1 to 30000
     Base.linkCityStreet.linkRecords (array (2, i)) // 30 000 records 
are linked NOW to city 2
   Next i
   For i=30001 to 30002
     Base.linkCityStreet.linkRecords (array (1, i)) // this 2 records 
are linked NOW to city 1
   Next i

There, there are not problems anymore!

Olivier



More information about the Valentina-beta mailing list