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

Remove Type_handler::Column_definition_fix_attributes()

    XMLWordPrintable

Details

    Description

      Type_handler::Column_definition_fix_attributes() is an addition for Type_handler::Column_definition_set_attributes(). Let's move all the code from virtual implementations of Column_definition_fix_attributes() to the corresponding virtual implementations of Column_definition_set_attributes().

      This change is needed to simplify handling of TYPE directives.

      In the upcoming task MDEV-10152 Add support for TYPE .. IS REF CURSOR there is a difference in the following two scenarios:

      TYPE rec0_t IS RECORD (a INT, b TIME);
      TYPE cur0_t IS REF CURSOR RETURN rec0_t;
      

      and

      TYPE rec0_t IS RECORD (a INT, b TIME);
      c0 rec0_t;
      TYPE cur0_t IS REF CURSOR RETURN c0%TYPE;
      

      • In the first scenario, the cursor's RETURN type is rec0_t, which is stored in sp_type_def_list as an sp_type_def_record instance whose Row_definition_list is populated with Spvar_definition element which have undergone through Column_definition_set_attributes() but have not ungergone through Column_definition_fix_attributes()
      • In the second scenario, the cursor's RETURN type is c0%TYPE - it's derived from a variable which have already ungergone both Column_definition_set_attributes() and Column_definition_fix_attributes().

      This difference is hard to handle.

      Unifying the two methods in a single method will make the code easier to understand and easier to maintain for the purposes like the descibed above.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Alexander Barkov Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.