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

Change Column_definition::field_name from "const char *" to LEX_CSTRING

    XMLWordPrintable

Details

    • 10.2.0-3

    Description

      This is needed as a pre-requisite for a few other tasks.
      Create_field::field_name and Field::field_name will be changed from "const char *" to a LEX_CSTRNG-alike structure, so both pointer and length are stored.

      This will help to:
      1. Avoid strlen() in some cases
      2. Put typical operations that are done on field names into method, to reuse the code (e.g. name comparision)
      3. Improve performance of name comparison. Currently field names are compared as follows:

        if (!my_strcasecmp(system_charset_info, field->field_name, other->field_name))
        {
         // handle fields with equal names
        }

      If we store length, the method comparing names could immediately return false if lengths are different.
      4. Simplify sql_yacc.yy, so data in various formats (LEX_CSTRING, LEX_STRING, const char *) will be easier to reuse.
      (in separate tasks)
      5. Make Field and Create_field closer to sp_variable, which is useful for the data type handlers. All these three classes could share some members and methods.

      Note, under terms of this task we won't change Item::name. It still will be of type "const char *".
      That means that we'll have to use strlen(item->name) when creating a Create_field or a Field from Item.
      This is Okey for now, in long terms we'll change Item::name as well and get rid of strlen().

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              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.