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

CASE with a mixture of TIME and DATETIME returns a wrong result

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
    • 10.3.0
    • Temporal Types

    Description

      This problem is similar to MDEV-11514, but now for the CASE operator.

      SELECT
        CASE TIME'10:20:30'
          WHEN 102030 THEN 'one'
          WHEN TIME'10:20:31' THEN 'two'
        END AS good,
        CASE TIME'10:20:30'
          WHEN 102030 THEN 'one'
          WHEN TIME'10:20:31' THEN 'two'
          WHEN TIMESTAMP'2001-01-01 10:20:32' THEN 'three'
        END AS bad;
      SHOW WARNINGS;
      

      +------+------+
      | good | bad  |
      +------+------+
      | one  | NULL |
      +------+------+
      

      +---------+------+------------------------------------+
      | Level   | Code | Message                            |
      +---------+------+------------------------------------+
      | Warning | 1292 | Incorrect datetime value: '102030' |
      +---------+------+------------------------------------+
      

      The expected result is to return "one" in both columns.

      Attachments

        Issue Links

          Activity

            People

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