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

Change Time/Datetime constructors to return warnings in MYSQL_TIME_STATUS

    Details

      Description

      This task is a self-sufficient part of MDEV-16991.

      In order to take into account nanoseconds during string-to-temporal conversion, these constructors:

      Time(int *warn, const char *str, size_t len, CHARSET_INFO *cs,
           const Options opt);
      Datetime(int *warn, const char *str, size_t len, CHARSET_INFO *cs,
               sql_mode_t flags);
      

      need to be changed to:

      Time(MYSQL_TIME_STATUS *status, const char *str, size_t len, CHARSET_INFO *cs
           const Options opt);
      Datetime(MYSQL_TIME_STATUS *status,
               const char *str, size_t len, CHARSET_INFO *cs,
                sql_mode_t flags);
      

      i.e. the "int *warn" parameter needs to be changed to "MYSQL_TIME_STATUS *status".

      Additionally, we'll move global character set aware functions:

      /* Character set-aware version of str_to_time() */
      bool str_to_time(CHARSET_INFO *cs, const char *str,size_t length,
                       MYSQL_TIME *l_time, ulonglong fuzzydate,
                       MYSQL_TIME_STATUS *status);
      /* Character set-aware version of str_to_datetime() */
      bool str_to_datetime(CHARSET_INFO *cs,
                           const char *str, size_t length,
                           MYSQL_TIME *l_time, ulonglong flags,
                           MYSQL_TIME_STATUS *status);
      

      as methods to class Temporal.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: