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

Specifying a space before the parenthesis can break some built-in functions

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.2.33, 10.3.24, 10.4.14, 10.5.5
    • N/A
    • Parser
    • None

    Description

      If you specify a space before the parenthesis, then some built-in functions will fail.

      For example, see TRIM():

      MariaDB [(none)]> SELECT TRIM ( 'foo' );
      ERROR 1305 (42000): FUNCTION TRIM does not exist
      MariaDB [(none)]> SELECT TRIM( 'foo' );
      +---------------+
      | TRIM( 'foo' ) |
      +---------------+
      | foo           |
      +---------------+
      1 row in set (0.000 sec)
      

      And NOW():

      MariaDB [(none)]> SELECT NOW ();
      ERROR 1305 (42000): FUNCTION NOW does not exist
      MariaDB [(none)]> SELECT NOW();
      +---------------------+
      | NOW()               |
      +---------------------+
      | 2020-08-28 23:02:43 |
      +---------------------+
      1 row in set (0.005 sec)
      

      However, some built-in functions seem to work just fine in this case.

      For example, see TRUNCATE():

      MariaDB [(none)]> SELECT TRUNCATE ( 0.01, 2 );
      +----------------------+
      | TRUNCATE ( 0.01, 2 ) |
      +----------------------+
      |                 0.01 |
      +----------------------+
      1 row in set (0.000 sec)
      MariaDB [(none)]> SELECT TRUNCATE(0.01, 2);
      +-------------------+
      | TRUNCATE(0.01, 2) |
      +-------------------+
      |              0.01 |
      +-------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Activity

          People

            ralf.gebhardt Ralf Gebhardt
            GeoffMontee Geoff Montee (Inactive)
            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.