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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    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;

      Attachments

        Activity

          People

            serg Sergei Golubchik
            philipstoev Philip Stoev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.