Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error with a optimized SELECT for a not nullable index k
Message
De
07/06/2004 06:28:52
 
 
À
06/06/2004 02:54:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00910353
Message ID:
00910670
Vues:
17

Hi Fabio,

This one fails. There are no dependences between these two scenarios.

Thanks,
Aleksey.


Aleksey, if a SEEK(NULL) into a not nullable key fire a error, then it is a design bug.

The correct implementation is this:
- search a NULL into a index must to be implemented with this logic:
if (searchValue is null) .and. (indexKey() is not nullable)
{
   JUMP TO RECCOUNT()+1 && go EOF()
   RETURN .F.           && not FOUND 
}
else
{
  SCAN THE INDEX B-TREE FOR THE FIRST NULL
}
You speaks with the VFPT, MS SQL Team, with several university professors, speaks with who you want,
but it does not have to generate a exception error.

Another example:
CLEAR
ON ERROR MESSAGEBOX(MESSAGE()+CHR(13)+'LINE'+STR(LINENO()),"BUG#228: aspected no errors")
CREATE CURSOR myCursor (id I NOT NULL)

INDEX ON id TAG tagId

nFound = 20000000000	&& this is not a I

? VARTYPE(m.nFound,.t.)
? SEEK(m.nFound)        && this not fire a error

nFound = NULL		&& this is a unknow I

? VARTYPE(m.nFound,.t.)
? SEEK(m.nFound)        && this fire a error data type error
Aleksey, considers these observations seriously. Thanks

Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform