Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17712

Remove C_TIME_FUZZY_DATES, C_TIME_DATETIME_ONLY, C_TIME_TIME_ONLY

    Details

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: