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

UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?

Details

    Description

      Hello,
      It seems that UNIX_TIMESTAMP(CURRENT_TIME()) returns null, but not UNIX_TIMESTAMP(CURRENT_TIMESTAMP())
      Is it wanted?
      Or is it a bug?
      Thank you for your reply

      – --------------------------------------
      SELECT
      UNIX_TIMESTAMP(CURRENT_TIME()),
      UNIX_TIMESTAMP(CURRENT_TIMESTAMP()),
      UNIX_TIMESTAMP(NOW())
      – --------------------------------------
      ;

      Attachments

        Activity

          alice Alice Sherepa added a comment -

          Thanks!
          I repeated on 10.4-10.6, while 10.3 returns the correct result.

          alice Alice Sherepa added a comment - Thanks! I repeated on 10.4-10.6, while 10.3 returns the correct result.
          bar Alexander Barkov added a comment - - edited

          The same problem is repeatable with this statement:

          MariaDB [test]> SELECT UNIX_TIMESTAMP(TIME'10:20:30');
          +--------------------------------+
          | UNIX_TIMESTAMP(TIME'10:20:30') |
          +--------------------------------+
          |                           NULL |
          +--------------------------------+
          

          Also repeatable in this script:

          CREATE OR REPLACE TABLE t1 (a TIME);
          INSERT INTO t1 VALUES ('10:20:30');
          SELECT UNIX_TIMESTAMP(a) FROM t1;
          

          +-------------------+
          | UNIX_TIMESTAMP(a) |
          +-------------------+
          |              NULL |
          +-------------------+
          1 row in set, 1 warning (1.767 sec)
          

          bar Alexander Barkov added a comment - - edited The same problem is repeatable with this statement: MariaDB [test]> SELECT UNIX_TIMESTAMP( TIME '10:20:30' ); + --------------------------------+ | UNIX_TIMESTAMP( TIME '10:20:30' ) | + --------------------------------+ | NULL | + --------------------------------+ Also repeatable in this script: CREATE OR REPLACE TABLE t1 (a TIME ); INSERT INTO t1 VALUES ( '10:20:30' ); SELECT UNIX_TIMESTAMP(a) FROM t1; +-------------------+ | UNIX_TIMESTAMP(a) | +-------------------+ | NULL | +-------------------+ 1 row in set, 1 warning (1.767 sec)

          People

            bar Alexander Barkov
            c.devel Christophe DEVEL
            Votes:
            1 Vote for this issue
            Watchers:
            7 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.