Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5, (14)
      10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4, 11.5(EOL), 11.6(EOL), 11.7(EOL)
    • 11.6.2
    • Data types, Temporal Types
    • None

    Description

      MariaDB [test]> select localtime;
      +---------------------+
      | localtime           |
      +---------------------+
      | 2024-08-28 13:48:03 |
      +---------------------+
      

      Looks wrong. According to the standard, LOCALTIME should return the TIME data type as follows:

      a) If <time precision> TP is specified, then LOCALTIME(TP) is equivalent to:
       
        CAST (CURRENT_TIME(TP) AS TIME(TP) WITHOUT TIME ZONE)
       
      b) Otherwise, LOCALTIME is equivalent to:
       
        CAST (CURRENT_TIME AS TIME WITHOUT TIME ZONE)
      

      LOCALTIME and LOCALTIMESTAMP are implemented as aliases to CURRENT_TIMESTAMP:

      lex.h:  { "LOCALTIME",	SYM(NOW_SYM)},
      lex.h:  { "LOCALTIMESTAMP",	SYM(NOW_SYM)},
      

      The alias for LOCALTIME is wrong. It should alias to CURRENT_TIME instead of CURRENT_TIMESTAMP.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            Description {noformat}
            MariaDB [test]> select localtime;
            +---------------------+
            | localtime |
            +---------------------+
            | 2024-08-28 13:48:03 |
            +---------------------+
            {noformat}

            Looks wrong. According to the standard, LOCALTIME should return the TIME data type as follows:

            {noformat}
            a) If <time precision> TP is specified, then LOCALTIME(TP) is equivalent to:

              CAST (CURRENT_TIME(TP) AS TIME(TP) WITHOUT TIME ZONE)

            b) Otherwise, LOCALTIME is equivalent to:

              CAST (CURRENT_TIME AS TIME WITHOUT TIME ZONE)
            {noformat}


            LOCALTIME and LOCALTIMESTAMP are implemented as aliases to NOW:

            {code:cpp}
            lex.h: { "LOCALTIME", SYM(NOW_SYM)},
            lex.h: { "LOCALTIMESTAMP", SYM(NOW_SYM)},
            {code}

            The alias for LOCALTIME is wrong. It should alias to CURRENT_TIME instead of NOW().
            {noformat}
            MariaDB [test]> select localtime;
            +---------------------+
            | localtime |
            +---------------------+
            | 2024-08-28 13:48:03 |
            +---------------------+
            {noformat}

            Looks wrong. According to the standard, LOCALTIME should return the TIME data type as follows:

            {noformat}
            a) If <time precision> TP is specified, then LOCALTIME(TP) is equivalent to:

              CAST (CURRENT_TIME(TP) AS TIME(TP) WITHOUT TIME ZONE)

            b) Otherwise, LOCALTIME is equivalent to:

              CAST (CURRENT_TIME AS TIME WITHOUT TIME ZONE)
            {noformat}


            LOCALTIME and LOCALTIMESTAMP are implemented as aliases to CURRENT_TIMESTAMP:

            {code:cpp}
            lex.h: { "LOCALTIME", SYM(NOW_SYM)},
            lex.h: { "LOCALTIMESTAMP", SYM(NOW_SYM)},
            {code}

            The alias for LOCALTIME is wrong. It should alias to CURRENT_TIME instead of CURRENT_TIMESTAMP.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Fix Version/s 11.6.2 [ 29908 ]
            Fix Version/s 11.6 [ 29515 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.