[MDEV-25771] Incorrect comparison of null dates Created: 2021-05-25  Updated: 2021-05-25

Status: Open
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 10.5.4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Mark Dierolf Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Attachments: PNG File Screenshot_20210525_081542.png     PNG File Screenshot_20210525_082948.png    

 Description   

Date comparisons involving null values are not working properly even in strict mode, or when NO_ZERO_DATE is defined.

testing> SET SESSION sql_mode = 'STRICT_ALL_TABLES';
testing> SELECT CAST('2031-33-99' as date), CAST('2021-05-25' as date), CAST('2031-33-99' as date) < CAST('2021-05-25' as date), CAST(null as date) < CAST('2021-05-25' as date), null < CAST('2021-05-25' as date)\G
**************************[ 1. row ]**************************
CAST('2031-33-99' as date) | <null>
CAST('2021-05-25' as date) | 2021-05-25
CAST('2031-33-99' as date) < CAST('2021-05-25' as date) | 1
CAST(null as date) < CAST('2021-05-25' as date) | <null>
null < CAST('2021-05-25' as date) | <null>


Generated at Thu Feb 08 09:40:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.