9 messages in com.mysql.lists.bugsRe: Query with having does not work p...
FromSent OnAttachments
Peter Zaitsev25 Jul 2000 06:23 
sas...@mysql.com25 Jul 2000 16:17 
Michael Widenius26 Jul 2000 03:07 
Peter Zaitsev27 Jul 2000 05:38 
Benjamin Pflugmann27 Jul 2000 10:24 
Peter Zaitsev28 Jul 2000 04:36 
Benjamin Pflugmann28 Jul 2000 09:49 
sas...@mysql.com28 Jul 2000 15:45 
Michael Widenius29 Jul 2000 11:08 
Subject:Re: Query with having does not work properly.
From:Michael Widenius (mon@mysql.com)
Date:07/26/2000 03:07:43 AM
List:com.mysql.lists.bugs

Hi!

"sasha" == sasha <sas@mysql.com> writes:

<cut>

1) Query which returns empty set instead of expected result: select visitor_id,max(ts) as mts from ct00g00visitors group by visitor_id having mts < DATE_SUB(NOW(),INTERVAL 3 MONTH);

<cut>

sasha> Here is an unofficial patch for this:

<cut>

sasha> Monty, I know this is not the most efficient way to do this, but I did
not want sasha> to mess with your val_str() - the right way, of course, is to have a
function sasha> that will compute the result in time format, and then have val_int()
convert it sasha> to longlong, and val_str() convert it to a string.

Your patch looks ok, but I have now split the date add/sub code to make it faster and shorter; This will be in 3.23.22 (I don't submit a patch now as I want to test this throughly before releasing it!)

Regards, Monty