Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug, equivalent aggrege SELECTs return different results
Message
 
 
À
01/12/2004 07:40:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00966025
Message ID:
00966027
Vues:
14
Hi Fabio,

The third select isn't equivalent to the first two because it has GROUP BY clause. It doesn't matter what you're grouping on. Here's MS SQL Server equivalent of the third query and it produces the same result as VFP
SELECT fa, COUNT(*) FROM (SELECT 1 AS FA, * FROM TT) dt1 GROUP BY fa
>Previous issue Thread #964674 and Thread #964973
>
>Bug/Issue : 18 of 36
>
>TITLE: Bug, equivalent aggregate SELECTs return different results
>
>VERSION: 09.00.0000.1720
>
>EXPECTED:
>these selects are invariant respect to a grouping operation
>
>SELECT aggregatefunc() FROM  Table
>SELECT constant,aggregatefunc() FROM  Table
>SELECT constant,aggregatefunc() FROM  Table GROUP BY 1
>
>therefore the result must be the same one.
>With a empty table, the first return 1 row,
>then all must to return 1 row.
>
>OBSERVED: on VFP8 you have 2 bugs, on VFP9b a bug it is fixed.
>
>NOTE: MS SQL removes the problem preventing the grouping of one constant ( fire a plan error )
>
>REPRO code with comments:
>
>CREATE CURSOR TT (F1 INT)
>* append blank  && if the thought wavers, uncommomment this line
>
>SET ENGINEBEHAVIOR 90
>
>* this explain the root concept, COUNT return the number of rows
>SELECT COUNT(*) FROM TT INTO CURSOR OK
>BROWSE TITLE "SET ENGINEBEHAVIOR 70,80,90 = 1 rows OK "
>
>* I ADD A CONSTANT COLUMN, this don't change the set
>* THEN EXPECTED ROWS ON RESULT MUST TO BE EQUAL TO THE PREVIOUS
>SELECT 1 FA,COUNT(*) FB FROM TT INTO CURSOR BUG8
>BROWSE TITLE "SET ENGINEBEHAVIOR 70,80 = 0 rows : BUG   90 = 1 rows FIXED"
>
>* I ADD A CONSTANT COLUMN AND GROUP THE CONSTANT VALUE,
>* BUT GROUPING A CONSTANT VALUE IT IS EQUAL NOT TO GROUP
>* THEN EXPECTED ROWS ON RESULT MUST TO BE EQUAL TO PREVIOUS
>SELECT 1 FA,COUNT(*) FB FROM TT GROUP BY 1 INTO CURSOR NOK
>BROWSE TITLE "SET ENGINEBEHAVIOR 70,80,90 = 0 rows : BUG"
>
>CLOSE TABLES
>
>
>Fabio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform