List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 17 1999 1:50am
Subject:Re: sum with group by in 3.23.3
View as plain text  
>>>>> "luuk" == luuk  <luuk@stripped> writes:

>> Am I just stupid, or does sum() with a group by still not work
luuk> in 3.23.3. =
>> (The eratta says it's been fixed).
>> 
>> A query like this works:
>> 
>> select sum(tot) from mytable;
>> 
>> This does not work:
>> 
>> select otherfield, sum(tot) from mytable group by otherfield;
>> 
>> The sum field is allways 0.
>> 

luuk> I just wanted to send the same message to the mailinglist. I
luuk> have the same problem here. The sum bug isn't fixed in version
luuk> .3.

Ouch ;(

It seams that the patch was left out from the distribution (and only
applied to my test system :()

This means that I will have to make a 3.23.4 VERY soon!

Fix:

*** include/global.h	Sun Aug 29 22:47:07 1999
--- /tmp/global.h	Fri Sep 17 04:48:41 1999
***************
*** 200,210 ****
  #define FALSE		(0)	/* Logical false */
  #endif
  
! #ifdef __GNUC__
  #define function_volatile	volatile
  #define my_reinterpret_cast(A) reinterpret_cast<A>
  #define my_const_cast(A) const_cast<A>
! #else
  #define my_reinterpret_cast(A) (A)
  #define my_const_cast(A) (A)
  #endif
--- 200,210 ----
  #define FALSE		(0)	/* Logical false */
  #endif
  
! #if defined(__GNUC__)
  #define function_volatile	volatile
  #define my_reinterpret_cast(A) reinterpret_cast<A>
  #define my_const_cast(A) const_cast<A>
! #elif !defined(my_reinterpret_cast)
  #define my_reinterpret_cast(A) (A)
  #define my_const_cast(A) (A)
  #endif
***************
*** 627,632 ****
--- 627,633 ----
  				  int4store((T),def_temp); \
  				  int4store((T+4),def_temp2); \
  				}
+ #ifdef WORDS_BIGENDIAN
  #define float4store(T,A)    { *(T)= ((byte *) &A)[3];\
                                *((T)+1)=(char) ((byte *) &A)[2];\
                                *((T)+2)=(char) ((byte *) &A)[1];\
***************
*** 657,662 ****
--- 658,669 ----
                                ((byte*) &def_temp)[6]=(M)[1];\
                                ((byte*) &def_temp)[7]=(M)[0];\
  			      (V) = def_temp; }
+ #else
+ #define float4get(V,M)   memcpy((byte*) &V,(byte*) (M),sizeof(float))
+ #define float4store(V,M) memcpy((byte*) &M,(byte*) (V),sizeof(float))
+ #define float8get(V,M)   doubleget((V),(M))
+ #define float8store(V,M) doublestore((V),(M))
+ #endif /* WORDS_BIGENDIAN */
  
  #endif /* sint2korr */
  
Regards,
Monty
Thread
sum with group by in 3.23.3Richard Ellerbrock16 Sep
Re: sum with group by in 3.23.3luuk16 Sep
  • Re: sum with group by in 3.23.3Aldrian Gintingsuka16 Sep
  • Re: sum with group by in 3.23.3Michael Widenius17 Sep