mirror of
https://github.com/MariaDB/server.git
synced 2025-12-09 08:01:34 +03:00
Add support for UNSIGNED types in InnoDB's SQL parser.
Remove trailing whitespace from flex/bison input files.
This commit is contained in:
@@ -114,7 +114,8 @@
|
||||
PARS_COMMIT_TOKEN = 340,
|
||||
PARS_ROLLBACK_TOKEN = 341,
|
||||
PARS_WORK_TOKEN = 342,
|
||||
NEG = 343
|
||||
PARS_UNSIGNED_TOKEN = 343,
|
||||
NEG = 344
|
||||
};
|
||||
#endif
|
||||
#define PARS_INT_LIT 258
|
||||
@@ -202,7 +203,8 @@
|
||||
#define PARS_COMMIT_TOKEN 340
|
||||
#define PARS_ROLLBACK_TOKEN 341
|
||||
#define PARS_WORK_TOKEN 342
|
||||
#define NEG 343
|
||||
#define PARS_UNSIGNED_TOKEN 343
|
||||
#define NEG 344
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -345,6 +345,8 @@ pars_column_def(
|
||||
pars_res_word_t* type, /* in: data type */
|
||||
sym_node_t* len, /* in: length of column, or
|
||||
NULL */
|
||||
void* is_unsigned, /* in: if not NULL, column
|
||||
is of type UNSIGNED. */
|
||||
void* is_not_null); /* in: if not NULL, column
|
||||
is of type NOT NULL. */
|
||||
/*************************************************************************
|
||||
|
||||
672
pars/lexyy.c
672
pars/lexyy.c
File diff suppressed because it is too large
Load Diff
1077
pars/pars0grm.c
1077
pars/pars0grm.c
File diff suppressed because it is too large
Load Diff
@@ -114,7 +114,8 @@
|
||||
PARS_COMMIT_TOKEN = 340,
|
||||
PARS_ROLLBACK_TOKEN = 341,
|
||||
PARS_WORK_TOKEN = 342,
|
||||
NEG = 343
|
||||
PARS_UNSIGNED_TOKEN = 343,
|
||||
NEG = 344
|
||||
};
|
||||
#endif
|
||||
#define PARS_INT_LIT 258
|
||||
@@ -202,7 +203,8 @@
|
||||
#define PARS_COMMIT_TOKEN 340
|
||||
#define PARS_ROLLBACK_TOKEN 341
|
||||
#define PARS_WORK_TOKEN 342
|
||||
#define NEG 343
|
||||
#define PARS_UNSIGNED_TOKEN 343
|
||||
#define NEG 344
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ yylex(void);
|
||||
%token PARS_COMMIT_TOKEN
|
||||
%token PARS_ROLLBACK_TOKEN
|
||||
%token PARS_WORK_TOKEN
|
||||
%token PARS_UNSIGNED_TOKEN
|
||||
|
||||
%left PARS_AND_TOKEN PARS_OR_TOKEN
|
||||
%left PARS_NOT_TOKEN
|
||||
@@ -450,8 +451,8 @@ fetch_statement:
|
||||
;
|
||||
|
||||
column_def:
|
||||
PARS_ID_TOKEN type_name opt_column_len opt_not_null
|
||||
{ $$ = pars_column_def($1, $2, $3, $4); }
|
||||
PARS_ID_TOKEN type_name opt_column_len opt_unsigned opt_not_null
|
||||
{ $$ = pars_column_def($1, $2, $3, $4, $5); }
|
||||
;
|
||||
|
||||
column_def_list:
|
||||
@@ -466,6 +467,13 @@ opt_column_len:
|
||||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
opt_unsigned:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_UNSIGNED_TOKEN
|
||||
{ $$ = &pars_int_token;
|
||||
/* pass any non-NULL pointer */ }
|
||||
;
|
||||
|
||||
opt_not_null:
|
||||
/* Nothing */ { $$ = NULL; }
|
||||
| PARS_NOT_TOKEN PARS_NULL_LIT
|
||||
|
||||
@@ -462,6 +462,10 @@ In the state 'quoted', only two actions are possible (defined below). */
|
||||
return(PARS_WORK_TOKEN);
|
||||
}
|
||||
|
||||
"UNSIGNED" {
|
||||
return(PARS_UNSIGNED_TOKEN);
|
||||
}
|
||||
|
||||
{ID} {
|
||||
yylval = sym_tab_add_id(pars_sym_tab_global,
|
||||
(byte*)yytext,
|
||||
|
||||
@@ -1085,6 +1085,8 @@ pars_set_dfield_type(
|
||||
pars_res_word_t* type, /* in: pointer to a type
|
||||
token */
|
||||
ulint len, /* in: length, or 0 */
|
||||
ibool is_unsigned, /* in: if TRUE, column is
|
||||
UNSIGNED. */
|
||||
ibool is_not_null) /* in: if TRUE, column is
|
||||
NOT NULL. */
|
||||
{
|
||||
@@ -1094,6 +1096,10 @@ pars_set_dfield_type(
|
||||
flags |= DATA_NOT_NULL;
|
||||
}
|
||||
|
||||
if (is_unsigned) {
|
||||
flags |= DATA_UNSIGNED;
|
||||
}
|
||||
|
||||
if (type == &pars_int_token) {
|
||||
if (len != 0) {
|
||||
ut_error;
|
||||
@@ -1158,7 +1164,7 @@ pars_variable_declaration(
|
||||
|
||||
node->param_type = PARS_NOT_PARAM;
|
||||
|
||||
pars_set_dfield_type(que_node_get_val(node), type, 0, FALSE);
|
||||
pars_set_dfield_type(que_node_get_val(node), type, 0, FALSE, FALSE);
|
||||
|
||||
return(node);
|
||||
}
|
||||
@@ -1529,6 +1535,8 @@ pars_column_def(
|
||||
pars_res_word_t* type, /* in: data type */
|
||||
sym_node_t* len, /* in: length of column, or
|
||||
NULL */
|
||||
void* is_unsigned, /* in: if not NULL, column
|
||||
is of type UNSIGNED. */
|
||||
void* is_not_null) /* in: if not NULL, column
|
||||
is of type NOT NULL. */
|
||||
{
|
||||
@@ -1541,7 +1549,7 @@ pars_column_def(
|
||||
}
|
||||
|
||||
pars_set_dfield_type(que_node_get_val(sym_node), type, len2,
|
||||
is_not_null != NULL);
|
||||
is_unsigned != NULL, is_not_null != NULL);
|
||||
|
||||
return(sym_node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user