List:General Discussion« Previous MessageNext Message »
From:Pete Harlan Date:September 13 2006 4:45pm
Subject:Bug in 4.1.21 with "between" comparing datetime and dates?
View as plain text  
I just filed bug #22317 about this.  The following script fails to
return a row under 4.1.21 (on x86_64, anyway), but works correctly on
4.1.20 (and .18):

	drop table if exists test1;
	create table test1
	(
	  datetimeval datetime,
	  dateval1 date,
	  dateval2 date
	);

	insert into test1
	  (datetimeval, dateval1, dateval2)
	values
	  ('2006-09-13 08:47:32', '2006-01-01', '2007-01-01');

	select datetimeval
	from test1 
	where datetimeval between dateval1 and dateval2;

If datetimeval is cast to a date in the where clause, the row is
returned in both versions.

--Pete

----------------------------------
Pete Harlan
ArtSelect, Inc.
harlan@stripped
http://www.artselect.com
ArtSelect is a subsidiary of a21, Inc.
Thread
Bug in 4.1.21 with "between" comparing datetime and dates?Pete Harlan13 Sep