[MDEV-720] LP:738069 - Comparisons between datetime and time work differently in 5.1-micro Created: 2011-03-19  Updated: 2012-11-16  Resolved: 2012-11-16

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.5.28a, 5.3.10

Type: Bug Priority: Minor
Reporter: Philip Stoev (Inactive) Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug738069.xml    

 Description   

I am filing this bug so that this issue remains on the radar and a decision of some sort is made.

As described by Monty:

In the microsecond patch, the only 'discussable convert' I know of is when you
compare a time value with a datetime value. In MySQL the
following where equal:

select cast('2001-01-02 00:00:01' as time) = cast("00:00:01" as time);
=>
select '00:00:01' = "00:00:01;
=>
true

In other words, when comparing a datetime with a time we only compared
the time part.

However after Serg's change the above is done:

select cast('2001-01-02 00:00:01' as time) = cast("00:00:01" as time);
=>
select ''2001-01-02 00:00:01' = "0000-00-00 00:00:01"
=>
false

The above worries me becasue someone could depend on this. My
suggestion was to either do the compare as before or give an error. An
error is in my opinion better as the applicaiton will notice this much
easier than a 'different result'.



 Comments   
Comment by Sergei Golubchik [ 2011-03-19 ]

Re: Comparisons between datetime and time work differently in 5.1-micro
This is intentional (and tested in the test suite).

Comment by Rasmus Johansson (Inactive) [ 2011-03-19 ]

Launchpad bug id: 738069

Generated at Thu Feb 08 06:30:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.