Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: SELECT NOT IN (SELECT ) result can be wrong
Message
From
24/06/2004 06:56:11
Neil Mc Donald
Cencom Systems P/L
The Sun, Australia
 
 
To
24/06/2004 05:32:53
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00916741
Message ID:
00916747
Views:
13
Hi,
I received the C000005 error, but after restart Foxpro the prg was missing from the project, the actual file was still where I had saved it.
Note I didn't save the project prior to running the prg.

This is the error reported in the Application event log

Faulting application vfp9.exe, version 9.0.0.1720, stamp 40aee08a, faulting module vfp9.exe, version 9.0.0.1720, stamp 40aee08a, debug? 0, fault address 0x00104a9f.


>Subject:
>on the Thread #915981 i post a program code where various SELECTs return incorrect data.
>Now i post a more evident program code where the SELECT data are bads, and explain why this occur.
>
>Run this code:
>
>
>CLEAR
>CREATE CURSOR T1 (F1 L NULL)
>FOR K=1 TO 100
>	INSERT INTO T1 VALUES (.T.)
>NEXT
>
>SYS(3054,11)
>
>* in the next query a temp index is used and the result is correct
>SELECT * FROM T1 WHERE F1 NOT IN (SELECT F1 FROM T1) INTO CURSOR R_IN
>? _TALLY, ' expected 100'
>
>* in the next query a temp index is used and the result is correct
>SELECT * FROM T1 WHERE F1 NOT IN (SELECT .T. FROM T1 GROUP BY 1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 0'
>
>* in the next query a cartesian product is used and result is not correct
>SELECT * FROM T1 WHERE F1 = ALL (SELECT .T. FROM T1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 100'
>
>* in the next query a cartesian product is used and result is not correct
>SELECT * FROM T1 WHERE F1 <> ANY (SELECT .F. FROM T1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 100'
>
>* in the next query a cartesian product is used and result is not correct
>SELECT * FROM T1 WHERE F1 <> ALL (SELECT .T. FROM T1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 0'
>
>* in the next query a cartesian product is used and result is not correct
>SELECT * FROM T1 WHERE F1 IN (SELECT .T. FROM T1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 0'
>
>* in the next query a cartesian product is used and result is not correct
>SELECT * FROM T1 WHERE F1 NOT IN (SELECT .T. FROM T1) INTO CURSOR R_NOT_IN
>? _TALLY, ' expected 0'
>
>
>
>
>If you observe the Rushmore ( SYS(3054) ) output,
>you can see that when the VFP Query Engine executes the query with a Cartesian product plan,
>the results of the query are wrong.
>Probably this is the internal cause of this bug,
>i.e the VFP Query Engine chooses the wrong execution plan,
>and returns the Cartesian product ( like an JOIN ).
>
>When you run the code specified above,
>the VFP environment can sometimes become corrupted,
>and randomly, C5 crash exceptions can occur.
>
>This bug occurs also in VFP8SP1.
>
>Fabio
Regards N Mc Donald
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform