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

LP:1034131 - select unix_timestamp('0000-00-00') returns NULL instead of 0

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      MariaDB 5.3.7 returns NULL instead of expected 0 for the the following query:

      MariaDB [(none)]> select unix_timestamp('0000-00-00');
      ------------------------------

      unix_timestamp('0000-00-00')

      ------------------------------

      NULL

      ------------------------------
      1 row in set (0.00 sec)

      Replacing MariaDB with MySQL 5.1 (Percona SQL server) returns expected 0 as in MySQL 5.0

      mysql> select unix_timestamp('0000-00-00');
      ------------------------------

      unix_timestamp('0000-00-00')

      ------------------------------

      0

      ------------------------------
      1 row in set (0.00 sec)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Re: select unix_timestamp('0000-00-00') returns NULL instead of 0
            Hi,

            This is intentional and documented behavior: http://kb.askmonty.org/en/unix_timestamp/
            (see Error handling at the bottom)

            Show
            elenst Elena Stepanova added a comment - Re: select unix_timestamp('0000-00-00') returns NULL instead of 0 Hi, This is intentional and documented behavior: http://kb.askmonty.org/en/unix_timestamp/ (see Error handling at the bottom)
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 1034131

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 1034131

              People

              • Assignee:
                Unassigned
                Reporter:
                sergiytytarenko Sergiy Tytarenko
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: