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

routine_definition in information_schema.routines loses tablename if it starts with an _ and is not backticked

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3, 10.4, 10.5
    • 10.3.29, 10.4.19, 10.5.10
    • Information Schema
    • None
    • I'm using MariaDB 10.3.20 but I'm guessing it also affects the latest version...

    Description

      -- sample to reproduce problem
      CREATE PROCEDURE test()
      BEGIN
        SELECT NULL FROM _table;
      END;
       
      SHOW CREATE PROCEDURE test;
      -- `Create Procedure` contains correct table name
       
      SELECT routine_definition FROM information_schema.routines WHERE routine_schema=DATABASE() AND specific_name='test';
      -- `routine_definition` contains " SELECT NULL FROM ;" (no table name!)
      

      I can also confirm this happens for triggers:

      CREATE TRIGGER test AFTER INSERT ON anytable FOR EACH ROW
      BEGIN
      SET @x=(SELECT NULL FROM _table);
      END;
       
      SHOW TRIGGERS;
      -- `statement` is missing _table
       
      SELECT action_statement FROM information_schema.triggers WHERE trigger_name='test';
      -- `ACTION_STATEMENT` is missing _table
       
      SHOW CREATE trigger test;
      -- SQL Original Statement is correct
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            AzzaAzza69 Azza
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.