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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 11.4.2
    • N/A
    • Data types
    • None
    • ubuntu 20.04

    Description

      select FIELD((case when true then ('i' || 'o') else '0' end), 'c') as c0;
      +----+
      | c0 |
      +----+
      |  0 |
      +----+
      1 row in set, 2 warnings (0.00 sec)
       
       
       
      select FIELD(('i' || 'o'), 'c') as c0;
      +----+
      | c0 |
      +----+
      |  1 |
      +----+
      1 row in set, 3 warnings (0.00 sec)
       
      
      

      The condition for CASE WHEN is TRUE, so this clause should return the result of ('i' || 'o'). This statement should return the same value as select FIELD(('i' || 'o'), 'c') as c0;, but the actual result is not the same.

      Attachments

        Activity

          People

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