[MDEV-391] INVALID DATES - allow invalid dates comparision (like mysql 5.5.25a) Created: 2012-07-12  Updated: 2013-06-25  Resolved: 2013-06-25

Status: Closed
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Trivial
Reporter: roberto spadim Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

hi, continuing report at MDEV-390, just to make a port of mysql to mariadb easier

could we implement a sql_mode to convert datetime fields to string when running comparisions ?
for example:
select * from table where field<'2012-07-01 25:00:00'
today it don´t return, since 25:00:00 isn´t allowed and date is converted to 0000-00-00 00:00:00
the idea is rewrite this query to
select * from table where CAST(field AS CHAR)<'2012-07-01 25:00:00'

and the query runs nice like today mysql 5.5.25a
maybe sql_mode='COMPARE_DATETIME_AS_CHAR'

i don´t know if we will have problem with ORDER BY and GROUP BY, but maybe it should convert 'wrong' datetime values to string in this case too (if any return value isn´t a valid date/time)



 Comments   
Comment by roberto spadim [ 2012-10-09 ]

i read the last source of maria db, and date time have changed (it's not more six fields like in 5.2.5)

but please could anyone implement this implicit cast to string? it make mariadb drop-in replacement of mysql and backcompatible, like mariadb says in https://kb.askmonty.org/en/what-is-mariadb/

thanks guys

Comment by roberto spadim [ 2013-06-25 ]

hi guys, could change to won't fix?

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