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

mysqltest: TRIM(NULL) Returns Empty String Instead of NULL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Not a Bug
    • 10.6.24
    • N/A
    • OTHER
    • None
    • Unexpected results
    • Q3/2026 Server Maintenance

    Description

      In mysqltest, the TRIM(NULL) expression returns an empty string ('') instead of NULL. This behavior is incorrect and inconsistent with how MySQL server evaluates TRIM(NULL).

      Test Case:

      let $tt1 = $(trim(null));
      -- echo trim(null) -> $tt1;           
      

      mysqltest output:

      worker[01] Using MTR_BUILD_THREAD 300, with reserved ports 19000..19029
      trim(null) -> ;                
      main.trim1                               [ pass ]    
      

      server output :

      MariaDB [(none)]> select trim(null);
      +------------+
      | trim(null) |
      +------------+
      | NULL       |
      +------------+
      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:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Git Integration

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