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

I_S.parameters not immediatly changed updated after procedure change

Details

    Description

      If having use a procedure, then in another connection, this procedure is changed (removing one parameter), a call to INFORMATION_SCHEMA.parameters will not reflect the changes in the the first connection.

      example to reproduce :
      create procedure :

      create or replace procedure metaChange(p1 int, p2 int)
      BEGIN
        select p1 as 'p1';
      END
      

      The failing scenario:

      • connection 1 : execute

        call metaChange(1, 2)
        

      • connection 1 : execute

        SELECT * FROM information_schema.parameters where SPECIFIC_NAME='metaChange';
        

        => return the p1 and p2 parameters as expected

      • connection 2 : change procedure:

        create or replace procedure metaChange(p1 int)
        BEGIN
          select p1 as 'p1';
        END
        

        procedure has now only one parameter

      • connection 2 : execute

        SELECT * FROM information_schema.parameters where SPECIFIC_NAME='metaChange';
        

        => return the p1 parameters as expected

      • connection 1 : execute

        SELECT * FROM information_schema.parameters where SPECIFIC_NAME='metaChange';
        

        => still return the p1 and p2 parameters

      Attachments

        Issue Links

          Activity

            julianbui Julian Bui added a comment -

            I think the step "connection 2 : change procedure" should have removed the "p2 int" parameter from the procedure's inputs.

            julianbui Julian Bui added a comment - I think the step "connection 2 : change procedure" should have removed the "p2 int" parameter from the procedure's inputs.
            julianbui Julian Bui added a comment - - edited

            Here is the original ticket I created that spawned this one: CONJ-1069

            As far as I know, the title of the ticket here is a little misleading and makes the problem seem less severe than it is? It's not that it doesn't "immediately" change, it just doesn't seem to change.

            julianbui Julian Bui added a comment - - edited Here is the original ticket I created that spawned this one: CONJ-1069 As far as I know, the title of the ticket here is a little misleading and makes the problem seem less severe than it is? It's not that it doesn't "immediately" change, it just doesn't seem to change.

            It possibly makes more sense to check if cache entry is not obsolete right in the sp_cache_lookup. In this way we ensure, that the similar situation won't happen under any circumstances. I don't think there can be any need to use obsolete object anywhere.

            Lawrin Lawrin Novitsky added a comment - It possibly makes more sense to check if cache entry is not obsolete right in the sp_cache_lookup. In this way we ensure, that the similar situation won't happen under any circumstances. I don't think there can be any need to use obsolete object anywhere.

            The new fix version doesn't remove obsolete sphead object from the cache entry, as it can be expected to exist by procedure being executed, but only does not take if for the forming of query results and compiles new object.

            In the fix sphead's version is compared with global cache version to decide if it's not obsolete and can be used. But probaibly it would better to add the method to the cache, that will tell if object is obsolete. As it looks like cache's job to tell that

            Lawrin Lawrin Novitsky added a comment - The new fix version doesn't remove obsolete sphead object from the cache entry, as it can be expected to exist by procedure being executed, but only does not take if for the forming of query results and compiles new object. In the fix sphead's version is compared with global cache version to decide if it's not obsolete and can be used. But probaibly it would better to add the method to the cache, that will tell if object is obsolete. As it looks like cache's job to tell that

            I've pushed the new version. I've checked all test failures - they also fail in other branches, and do not really look like smth that I could cause. Could you please review the patch?

            Lawrin Lawrin Novitsky added a comment - I've pushed the new version. I've checked all test failures - they also fail in other branches, and do not really look like smth that I could cause. Could you please review the patch?

            OK to puh

            sanja Oleksandr Byelkin added a comment - OK to puh

            Looks it's making to the 10.6.15

            Lawrin Lawrin Novitsky added a comment - Looks it's making to the 10.6.15

            People

              Lawrin Lawrin Novitsky
              diego dupin Diego Dupin
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.