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

Preparations for associative arrays (MDEV-34319)

    XMLWordPrintable

Details

    Description

      Under terms of this task we'll add some more abstraction methods in a few classes to integrate the upcoming data type associative_array easier.

      Doing these changes separately before the main patch for assiciative_array will help to split a big patch into two smaller independent patches, thus making them both easier to read.

      Details

      • Add new classes sp_type_def and sp_type_def_list. Move the member sp_pcontext::m_records to the new class sp_type_def_list, derive sp_pcontext from it. Put the new classes definition into a new file sp_type_def.h.
      • Add new methods in my_var_sp:

          virtual bool set_row(THD *thd, List<Item> &select_list)
         
          virtual bool check_assignability(THD *thd,
                                           const List<Item> &select_list,
                                           bool *assign_as_row) const
        

      • Add a new method in Field:

        // E.g. Item_field, Item_field_row
        virtual Item_field *make_item_field_spvar(THD *thd,
                                                  const Spvar_definition &def);
      

      • Add new methods in Type_handler:

        virtual bool has_null_predicate() const { return true; }
       
        virtual bool sp_variable_declarations_finalize(THD *thd,
                                                       LEX *lex, int nvars,
                                                       const Column_definition &def)
                                                                              const;
        // SELECT 1 INTO spvar;
        virtual my_var *make_outvar(THD *thd,
                                    const Lex_ident_sys_st &name,
                                    const sp_rcontext_addr &addr,
                                    sp_head *sphead,
                                    bool validate_only) const;
        // SELECT 1 INTO spvar.field;
        virtual my_var *make_outvar_field(THD *thd,
                                          const Lex_ident_sys_st &name,
                                          const sp_rcontext_addr &addr,
                                          const Lex_ident_sys_st &field,
                                          sp_head *sphead,
                                          bool validate_only) const;
       
        virtual Item *make_typedef_constructor_item(THD *thd,
                                                   const sp_type_def &def,
                                                   List<Item> *arg_list) const;
      
      

      Attachments

        Issue Links

          Activity

            People

              ramesh Ramesh Sivaraman
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.