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

Reuse Temporal_hybrid in xxx_to_date_with_warn()

    XMLWordPrintable

Details

    Description

      MDEV-16991 will integrate nanosecond rounding functionality as methods into class Temporal (and its descendants Time, Datetime and Temporal_hybrid). There will be no rounding functionality for pure MYSQL_TIME.

      To reuse rounding easier in these functions:

      • str_to_datetime_with_warn()
      • double_to_datetime_with_warn()
      • decimal_to_datetime_with_warn()
        we need to remove direct calls for functions like str_to_datetime(), which operate on pure MYSQL_TIME, and add Temporal_hybrid constructors instead. So nanoseconds rounding will automatically start working in xxx_to_datetime_with_warn() as soon as it's implemented in Temporal_hybrid constructors.

      A constructor making a Temporal_hybrid from strings already exists and is used in Type_handler_temporal_with_date::create_literal_item() and Type_handler_date_common::create_literal_item(). str_to_datetime_with_warn() will reuse it.

      A new constructor making a Temporal_hybrid from numbers (namely from Sec6) will be added under terms of this task.
      Functions double_to_datetime_with_warn(), decimal_to_datetime_with_warn(), int_to_datetime_with_warn() will reuse this new constructor.

      This is a self-containing dependency change to make the future patch for MDEV-16991 as simple and clear as possible.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.