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

IF() function is returning incorrect error

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q3/2026 Server Maintenance

    Description

      The IF() function is not implemented in mysqltest. However, when we attempt to use IF() in test scripts, it is incorrectly interpreted as IFNULL(), leading to misleading or incorrect error messages during test execution.

      Test Case:

      let $lt36 = $(if(null,"   fallback", "   actual"));
      -- echo (if(null, "   fallback", "   actual") -> $lt36;
      

      Mysqltest Output:
      mysqltest: At line 1: ifnull() expects 2 arguments, got 3

      Server Output:

      MariaDB [(none)]> select if(null,"   fallback", "   actual");
      +-------------------------------------+
      | if(null,"   fallback", "   actual") |
      +-------------------------------------+
      |    actual                           |
      +-------------------------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            People

              Khaled.amr Khaled Amr
              poojalamba16 Pooja Rani Lamba
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5d Original Estimate - 0.5d
                  0.5d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 6.25h
                  6.25h

                  Git Integration

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