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

Replace Item_func::get_arg0_date() to Date/Datetime methods

    XMLWordPrintable

Details

    Description

      Item_func has this method:

      inline bool get_arg0_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
      {
        DBUG_ASSERT(!(fuzzy_date & TIME_TIME_ONLY));
        Datetime dt(current_thd, args[0], fuzzy_date);
        return (null_value= dt.copy_to_mysql_time(ltime));
      }
      

      which now handles DATE and DATETIME data types.

      After MDEV-16991, it won't be possible to have this method, because DATE and DATETIME will have different rounding behavior.

      Under terms of this fact, the following changes will be done:

      1. get_arg0_date() will be removed
      2. All get_arg0_date() calls will be replaced to instantiation of Date or Datetime (depending on the data type needed) and accessing their members through various methods.
      3. To simplify the code in item_timefunc.cc and to reuse some duplicate code, the following methods will be added into Date and/or Datetime:

      • daynr()
      • to_seconds()
      • check_date()
      • dayofyear()
      • quarter()
      • week()
      • yearweek()

      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.