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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not a Bug
    • Affects Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5
    • Fix Version/s: N/A
    • Component/s: Parser
    • Labels:
      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

            Assignee:
            ralf.gebhardt@mariadb.com Ralf Gebhardt
            Reporter:
            GeoffMontee Geoff Montee
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration