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

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

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

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            Description 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.


            Add a structure instead:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.


            bar Alexander Barkov made changes -
            Description Add a structure instead:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.


            Passing data in sql_yacc.yy through LEX members is hard to follow and is not recursively safe.
            We'll get rid of
            Add a structure instead:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.


            bar Alexander Barkov made changes -
            Description Passing data in sql_yacc.yy through LEX members is hard to follow and is not recursively safe.
            We'll get rid of
            Add a structure instead:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.


            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:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
            bar Alexander Barkov made changes -
            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:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
            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:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
            This will allow, for example, to change:
            {code}
            field_spec:
              field_ident { /* new Create_field is allocated here */}
              field_type { Lex->set_last_field_type($3); }
              field_def { ... }
              ;
            {code}
            into:
            {code}
            field_spec:
              field_ident field_type { /* new Create field is allocated here*/ }
              field_def { ... }
            {code}

            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.
            bar Alexander Barkov made changes -
            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:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
            This will allow, for example, to change:
            {code}
            field_spec:
              field_ident { /* new Create_field is allocated here */}
              field_type { Lex->set_last_field_type($3); }
              field_def { ... }
              ;
            {code}
            into:
            {code}
            field_spec:
              field_ident field_type { /* new Create field is allocated here*/ }
              field_def { ... }
            {code}

            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.
            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:
            {code}
            struct Lex_length_and_dec_st
            {
              const char *length;
              const char *dec;
            };
            {code}
            so it can be passed through the syntax rules in sql_yacc.yy as $$, $1, $2, etc.
            This will help, for example, to change:
            {code}
            field_spec:
              field_ident { /* new Create_field is allocated here */}
              field_type { Lex->set_last_field_type($3); }
              field_def { ... }
              ;
            {code}
            into:
            {code}
            field_spec:
              field_ident field_type { /* new Create field is allocated here*/ }
              field_def { ... }
            {code}

            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.
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            bar Alexander Barkov made changes -
            Component/s Parser [ 10201 ]
            Fix Version/s 10.2.0 [ 20700 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            Resolution Fixed [ 1 ]
            Status Closed [ 6 ] Stalled [ 10000 ]
            bar Alexander Barkov made changes -
            Sprint 10.2.0-1 [ 21 ]
            bar Alexander Barkov made changes -
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            Issue Type Bug [ 1 ] Task [ 3 ]
            bar Alexander Barkov made changes -
            Labels duplicate-code
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 72704 ] MariaDB v4 [ 132731 ]

            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.