[MDEV-4627] ISO8601 strings not allowed as datetime input Created: 2013-06-09  Updated: 2013-07-09  Due: 2013-07-07  Resolved: 2013-07-09

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

Type: Bug Priority: Minor
Reporter: Oskar Levin (Inactive) Assignee: Sergei Golubchik
Resolution: Incomplete Votes: 0
Labels: None
Environment:

CentOS 6.4 x64



 Description   

When trying to input an ISO8601 string as a datetime value, the SQL query fails.

UPDATE `users` SET `activity` = '2013-06-07T18:15:51+0800' WHERE id = '1';
Invalid datetime format: 1292 Incorrect datetime value: '2013-06-07T18:15:51+0800' for column 'activity' at row 1

This works in MySQL 5.5 (tried with 5.5.29).



 Comments   
Comment by Sergei Golubchik [ 2013-06-09 ]

I cannot repeat it. Both in MySQL and in MariaDB I get a warning, and the value is updated.

In MySQL the warning is "Out of range value for column 'activity' at row 1" in MariaDB the warnings is "Data truncated for column 'activity' at row 1". Our warning is correct, there's nothing "out of range" here, instead the string-to-time conversion routine does not understand time zones (neither in MySQL nor in MariaDB), so the resulting datetime value comes from a truncated string.

Could you provide a complete repeatable test case that shows the incorrect behavior?

Comment by Elena Stepanova [ 2013-06-09 ]

Please also check that you have the same sql_mode value in your MariaDB and MySQL configuration. "Incorrect datetime value" error is something you'd get in a strict mode, e.g. with STRICT_ALL_TABLES (again, both with MySQL and MariaDB).

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