[MDEV-7845] update date column with erroneous date does not return an error but sets to null Created: 2015-03-26 Updated: 2015-04-30 Due: 2015-04-26 Resolved: 2015-04-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Affects Version/s: | 10.0.16 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Peter McLarty | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Redhat Linux 2.6.32-431.29.2.el6.x86_64 |
||
| Issue Links: |
|
||||||||
| Description |
|
We came across this issue when a developer tried to set a date value to 2015-04-31 only 30 days in April. Test case
Insert some values
Check the contents All dates set to 01/01/1970
Update to erroneous date value
Evaluate the result
Date is now null in the column set to erroneous date |
| Comments |
| Comment by Elena Stepanova [ 2015-03-26 ] | |||||||||||
|
Hi Peter,
Do you actually mean NULL, or do you mean '0000-00-00'? If you mean '0000-00-00', then please note that when you run the UPDATE, you get a warning (or a bunch of warnings) like this:
It works the same way in MySQL, it is an expected and documented behavior. See
So, for the first example, '2015-04-31':
For the second example, '2013-10-32':
Hopes it clarifies the matter. | |||||||||||
| Comment by Elena Stepanova [ 2015-04-30 ] | |||||||||||
|
Closing as not-a-bug for now. Please feel free to comment to re-open the issue if you disagree and have additional information. |