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

Get rid of LEX::length and LEX::dec

    XMLWordPrintable

Details

    • 10.2.0-1

    Description

      Passing data in sql_yacc.yy through LEX members is hard to follow and is not recursively safe.
      We'll get rid of LEX::length and LEX::dec and add a structure instead:

      struct Lex_length_and_dec_st
      {
        const char *length;
        const char *dec;
      };

      so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
      This will help, for example, to change:

      field_spec:
        field_ident { /* new Create_field is allocated here */}
        field_type { Lex->set_last_field_type($3); }
        field_def { ... }
        ;

      into:

      field_spec:
        field_ident field_type { /* new Create field is allocated here*/ }
        field_def { ... }

      So we'll already know data type, length and dec when we do "new Create_field".
      This will allow to call a method in Type_handler, to create a data-type specific "Create_field" replacement, instead of using the generic universal Create_field.

      Attachments

        Issue Links

          Activity

            People

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