RE: Bug in BETWEEN same DATETIME

2013-05-29 Thread Rick James
AM To: mysql@lists.mysql.com Subject: Re: Bug in BETWEEN same DATETIME 2013/05/24 09:49 -0400, shawn green Or we could coerce datetime values back to their date values when both are being used. The trick now becomes choosing between rounding the datetime value (times past noon round

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread shawn green
Hello Rick, On 5/23/2013 7:08 PM, Rick James wrote: Watch out for CAST(), DATE(), and any other function. In a WHERE clause, if you hide an indexed column inside a function, the index cannot be used for optimization. INDEX(datetime_col) ... WHERE DATE(datetime_col) = '2013-01-01'

RE: Bug in BETWEEN same DATETIME

2013-05-24 Thread Rick James
of a recurring event on a calendar, a sporting event, an appointment (potentially in a diff timezone), train schedule, etc. -Original Message- From: shawn green [mailto:shawn.l.gr...@oracle.com] Sent: Friday, May 24, 2013 6:50 AM To: mysql@lists.mysql.com Subject: Re: Bug in BETWEEN same

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread shawn green
Hi Rick, Thank you for continuing this. It brings up a few good points. On 5/24/2013 12:17 PM, Rick James wrote: For years (even decades), I have stayed out of trouble by assuming a 'date' represents the instant in time corresponding to midnight at the start of that day. In MySQL (until

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread hsv
2013/05/24 09:49 -0400, shawn green Or we could coerce datetime values back to their date values when both are being used. The trick now becomes choosing between rounding the datetime value (times past noon round to the next date) or do we use the floor() function all the time. This is

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Andrew Moore
Sorry, that was meant to be; WHERE (new column stored as date) = '2013-04-16' On Thu, May 23, 2013 at 10:16 PM, Andrew Moore eroomy...@gmail.com wrote: Personally I don't share your view that it's a bug. Omitting the time results in midnight by default so this screws between because there's

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Rick James
. -Original Message- From: Michael Dykman [mailto:mdyk...@gmail.com] Sent: Thursday, May 23, 2013 2:56 PM To: MySql Subject: Re: Bug in BETWEEN same DATETIME where cast(transaction_date as date) BETWEEN '2013-04-16' AND This approach might be problematic in that it requires

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Rick James
[mailto:shawn.l.gr...@oracle.com] Sent: Thursday, May 23, 2013 3:50 PM To: mysql@lists.mysql.com Subject: Re: Bug in BETWEEN same DATETIME On 5/23/2013 4:55 PM, Daevid Vincent wrote: I just noticed what I consider to be a bug; and related, has this been fixed in later versions of MySQL

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread shawn green
On 5/23/2013 4:55 PM, Daevid Vincent wrote: I just noticed what I consider to be a bug; and related, has this been fixed in later versions of MySQL? We are using: mysql Ver 14.12 Distrib 5.0.92, for portbld-freebsd8.1 (amd64) using 5.2 If you use BETWEEN and the same date for both parts

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Michael Dykman
-Original Message- From: Daevid Vincent [mailto:dae...@daevid.com] Sent: Thursday, May 23, 2013 3:56 PM To: mysql@lists.mysql.com Subject: Bug in BETWEEN same DATETIME I just noticed what I consider to be a bug; and related, has this been fixed in later versions of MySQL? We are using

RE: Bug in BETWEEN same DATETIME

2013-05-23 Thread Peterson, Timothy R
, 2013 3:56 PM To: mysql@lists.mysql.com Subject: Bug in BETWEEN same DATETIME I just noticed what I consider to be a bug; and related, has this been fixed in later versions of MySQL? We are using: mysql Ver 14.12 Distrib 5.0.92, for portbld-freebsd8.1 (amd64) using 5.2 If you use BETWEEN

Re: Bug in BETWEEN same DATETIME

2013-05-23 Thread Andrew Moore
Personally I don't share your view that it's a bug. Omitting the time results in midnight by default so this screws between because there's no time between 00:00:00 and 00:00:00. Are you having operational issues here or are you simply fishing for bugs? WHERE `transaction_date` = DATE(datetime)