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

Inconsistency between CREATE FUNCTION SYSDATE and DROP FUNCTION SYSDATE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • Parser

    Description

      This query:

      DROP FUNCTION IF EXISTS SYSDATE;
      

      works normally and returns no errors.

      This query:

      CREATE FUNCTION SYSDATE() RETURNS INT RETURN 10;
      

      returns an error:

      ERROR 1064 (42000): You have an error in your SQL syntax ... near 'SYSDATE() ...
      

      There is an inconsistency in here.
      Either both queries should return an error, or both work with no errors.

      The best solution is to make both queries work, as we generally allow to create stored functions that have the same names with built-in functions:

      DROP FUNCTION IF EXISTS CONCAT;
      CREATE FUNCTION CONCAT(a TEXT) RETURNS TEXT RETURN 'test';
      SELECT test.CONCAT('dummy');
      DROP FUNCTION CONCAT;
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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