Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rushmore, don't get it
Message
De
21/04/2005 07:38:05
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01006860
Message ID:
01006905
Vues:
17
Thanks for confirming. I was hoping there was a way around. There's an index I cannot use. O hell, as long as it works

>I see this in VFP8SP1 but not in VFP9. It looks like a bug that has been fixed in VFP9.
>
>>I've come across something peculiar re RushMore.
>>
>>Basically, it's as if it were not seeing some index entries
>>
>>I've nailed it down to a simple test, but in real life, a select would return eg 64 records where it should return eg 108
>>
>>The only way around I've found so far is to not use the index expression, use (j_ref = 0) instead of (bintoc(j_ref) == bintoc(0))
>>
>>Disabling Rushmore gives correct results in both locate and scan, but not in select sql
>>
>>I'd like to (1) understand what is going on and (2) find a way around it and use the index expr
>>
>>
>>function Do_It()
>>	
>>	
>>	set ansi on
>>	set exact on
>>	set collate to 'machine'
>>	set optimize on
>>	
>>	create cursor CursorTest ;
>>		( 	j_ref		I ;
>>		)
>>	
>>	insert into CursorTest values(44 )
>>	insert into CursorTest values( 0 )
>>	insert into CursorTest values(44 )
>>
>>	index on bintoc(j_ref) tag j_ref
>>
>>	?'-------------------------------------'
>>	
>>	locate for (bintoc(j_ref) == bintoc(0))
>>	?'optimize locate 0 (TRUE)', found(), '  ERROR'
>>
>>	locate for (bintoc(j_ref) == bintoc(0)) NOOPTIMIZE
>>	?'no optimize locate 0 (TRUE)', found(), ' OK'
>>	
>>	local aa[1]
>>	aa[1] = 0
>>	
>>	select count(*) ;
>>		from CursorTest ;
>>		into array aa ;
>>		where (bintoc(j_ref) == bintoc(0))
>>	
>>	?'optimize count 0 (1):', aa[1], ' ERROR'
>>	
>>	set optimize off
>>	select count(*) ;
>>		from CursorTest ;
>>		into array aa ;
>>		where (bintoc(j_ref) == bintoc(0))
>>	set optimize on
>>	
>>	?'no optimize count 0 (1):', aa[1], aa[1], ' ERROR'
>>	
>>	
>>	locate for (bintoc(j_ref) == bintoc(44))
>>	?'optimize locate 44 (TRUE), recno 1:', found(), 'OK ', recno()
>>	
>>	insert into CursorTest  values( 0 )
>>	locate for (bintoc(j_ref) == bintoc(0))
>>	?'optimize locate 0 (TRUE), recno 2:', found(), recno(), 'ERROR'
>>	
>>
>>endfunc
>>
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform