Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
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
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
Activity
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. |
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. |
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. |
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. |
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. |
Component/s | Parser [ 10201 ] | |
Fix Version/s | 10.2.0 [ 20700 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Sprint | 10.2.0-1 [ 21 ] |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Issue Type | Bug [ 1 ] | Task [ 3 ] |
Labels | duplicate-code |
Workflow | MariaDB v3 [ 72704 ] | MariaDB v4 [ 132731 ] |