[MDEV-17712] Remove C_TIME_FUZZY_DATES, C_TIME_DATETIME_ONLY, C_TIME_TIME_ONLY Created: 2018-11-14  Updated: 2018-11-17  Resolved: 2018-11-17

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Fix Version/s: 10.4.1

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-16991 Rounding vs truncation for TIME, DATE... Closed

 Description   

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

Rationale:

  • 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:

  • str_to_datetime_or_date_or_time()
  • str_to_datetime_or_date()
  • number_to_datetime_or_date()
  • number_to_time_only()

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.


Generated at Thu Feb 08 08:38:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.