[MDEV-7824] [Bug #68041] Zero date can be inserted in strict no-zero mode through a default value Created: 2015-03-24 Updated: 2015-09-15 Resolved: 2015-06-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Affects Version/s: | 5.5.42, 10.0.17, 10.1.3 |
| Fix Version/s: | 10.1.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Issue Links: |
|
||||||||
| Sprint: | 10.1.6-1 | ||||||||
| Description |
|
Upstream bug: http://bugs.mysql.com/bug.php?id=68041 I create a table with zero date:
Now change sql_mode to traditional:
It correctly rejects the value:
However, It's still possible to insert the bad value through the default:
The INSERT statement works (even without warnings) and the SELECT statement returns:
The expected behaviour would be to reject the INSERT that uses the default value '0000-00-00'. Using DEFAULT also does not reject:
It also does not reject bad values when using INSERT..SELECT:
|
| Comments |
| Comment by Alexander Barkov [ 2015-03-24 ] |
|
In MySQL-5.7, the patch for explicit_defaults_for_timestamp depends on the code that fixes this bug. |