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

LP:738091 - cast(timestamp() AS time returns NULL for 0000-00-00 00:00:00 in 5.1-micro

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      In 5.1-micro, the following expression

      cast(timestamp(f1) AS time)

      returns NULL if f1 = 0000-00-00 00:00:00 . In mysql-5.1 , it returns 00:00:00, which is the more intuitive result

      test case:

      drop table t1;
      create table t1 (f1 datetime);
      insert into t1 values ('0000-00-00 00:00:00');
      select cast(timestamp(f1) AS time) from t1;

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 738091

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

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: