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

Although the CASE WHEN clause returns the same value as the direct concatenation, NULLIF yields different results in each case.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.2
    • 10.5
    • Data types
    • None
    • ubuntu 20.04

    Description

      select nullif(SPACE(5), case when false then ('TEST') else ('l' || 'o') end) as c1;
      +-------+
      | c1    |
      +-------+
      |       |
      +-------+
      1 row in set, 2 warnings (0.00 sec)
       
       
       
      select nullif(SPACE(5), ('l' || 'o')) as c1;
      +------+
      | c1   |
      +------+
      | NULL |
      +------+
      1 row in set, 3 warnings (0.00 sec)
       
      
      

      The condition for CASE WHEN is FALSE, so this clause should return the result of (l || o). This statement should return the same value as SELECT NULLIF(SPACE(5), ('l' || 'o')) AS c1;, but the actual result is not the same.

      Attachments

        Activity

          People

            bar Alexander Barkov
            Wangdada HeShan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.