1 Reply Latest reply on Jul 12, 2017 3:06 AM by Andrew Waters

    Custom Patterns Flagged by Upgrade after 11.1 upgrade

    Rajat Jain
      Share:|

      I have upgraded ADDM from 11.0.0.3 to 11.1.0.2

       

      After upgrade 3 of my custom patterns are showing error as:

       

      Module NameErrors & WarningsActive
      Custom.Database.DatabaseBaseDiscoveryAudit
      • Variable 'query_results' may be used uninitialised
      • Variable 'query_results' may be used uninitialised
      Yes
      Custom.MSSQL.MSSQL_Extended
      • Variable 'role_description' may be used uninitialised
      • Variable 'role_description' may be used uninitialised
      • Variable 'dt_type' may be used uninitialised
      • Variable 'name' may be used uninitialised
      • Variable 'name' may be used uninitialised
      • Variable 'name' may be used uninitialised
      • Variable 'type_description' may be used uninitialised
      • Variable 'dt_type' may be used uninitialised
      Yes
      Custom.Sybase.SybaseASE_Extended
      • Variable 'edition' may be used uninitialised
      • Variable 'license_name' may be used uninitialised
      • Variable 'license_type' may be used uninitialised
      • Variable 'license_version' may be used uninitialised
      • Variable 'license_quantity' may be used uninitialised
      • Variable 'license_status' may be used uninitialised
      • Variable 'license_expirey' may be used uninitialised
      • Variable 'edition' may be used uninitialised
      • Variable 'license_name' may be used uninitialised
      • Variable 'license_type' may be used uninitialised
      • Variable 'license_version' may be used uninitialised
      • Variable 'license_quantity' may be used uninitialised
      • Variable 'license_status' may be used uninitialised
      • Variable 'license_expirey' may be used uninitialised
      • Variable 'key' may be used uninitialised
      • Variable 'name' may be used uninitialised
      • Variable 'short_name' may be used uninitialised
      • Variable 'cmd_version' may be used uninitialised
      • Variable 'product_version' may be used uninitialised
      • Variable 'cmd_version' may be used uninitialised
      • Variable 'cmd_version' may be used uninitialised
      • Variable 'product_version' may be used uninitialised
      • Variable 'cmd_version' may be used uninitialised

       

       

      Please suggest what has caused this error? What is the impact of it? How to resolve this issue?

       

      Regards,

      Rajat Jain

        • 1. Re: Custom Patterns Flagged by Upgrade after 11.1 upgrade
          Andrew Waters

          They are warnings, not errors. It is telling you that there appear to be paths through the patterns where the name variable is used but has never been assigned a value. If you ever manage to pass through one of these paths the pattern will fail. The way to fix it is to modify the pattern so that the variable is always initialised. So the code

          if test1 then

            x := 1;

          end if;

           

          if test2 then

            a: = x + 1;

          end if;

          only initialises x if test1 is true. If test2 is only ever true when test1 is true then there will not be a problem. However, if test2 can be true when test1 is not true then x can be used without initialising it causing an error. Possible changes being

          if test1 then

            x:= 1;

          else

            x := 0;

          end if;

          or

          x := 0;

          if test 1 then

            x := 1;

          end if;

          both of which ensure x is initialised to a value.

          2 of 2 people found this helpful