Status: Closed (View Workflow)
Under terms of this task we'll do the following things:
- Remove completely C_TIME_DATETIME_ONLY
- Remove C_TIME_FUZZY_DATES, but keep TIME_FUZZY_DATES
- Remove C_TIME_TIME_ONLY, but keep TIME_TIME_ONLY
- C_TIME_FUZZY_DATES is not needed: TIME_FUZZY_DATES is used in /sql only
- C_TIME_DATETIME_ONLY is used internally in functions defined in my_time.cc an is never passed outside
- C_TIME_TIME_ONLY is confusing, see below.
Functions in sql-common/my_time.c have confusing names and work inconsistently to each other:
- str_to_datetime() returns TIME if TIME_TIME_ONLY is set, or DATETIME or DATE otherwise
- number_to_datetime() returns DATETIME or DATE (and never TIME)
- str_to_time() returns DATETIME, DATE or TIME, dependently on length and flags
- number_to_time() returns DATETIME, DATE or TIME, independently from flags
We'll replace them to self-descriptive functions, which won't depend on flags:
Instead of passing C_TIME_TIME_ONLY to functions from my_time.cc, the upper level will choose between the new functions.
This will help to add support of time intervals easier soon: the C++ level will have a new flag TIME_TIME_INTERVAL.
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP