[MDEV-14278] Bad result for UNIX_TIMESTAMP(zero_timestamp_field) Created: 2017-11-03 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data types, Temporal Types |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
This script erroneously returns 0 for a zero TIMESTAMP field:
This is wrong. The value 0000-00-00 00:00:00 is a special value for zero TIMESTAMPs. UNIX_TIMESTAMP in the above example confuses the special zero TIMESTAMP value of 0000-00-00 00:00:00 with a real time_t=0. Note, if I wrap the field into COALESCE, it starts returning correct results:
If I wrap the field into MAX, it also correctly returns NULL:
|
| Comments |
| Comment by Alexander Barkov [ 2017-11-23 ] | |||||||||||||||||||||||||||||
|
Unfortunately, the intended patch breaks distribution between partitions, e.g. in partition_datatypes.test.
|