Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with a optimized SELECT for a not nullable index k
Message
From
07/06/2004 06:28:52
 
 
To
06/06/2004 02:54:40
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00910353
Message ID:
00910670
Views:
21

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform