diff --git a/src/dsql/keywords.cpp b/src/dsql/keywords.cpp index 7ac4a92fa9..62b61d2759 100644 --- a/src/dsql/keywords.cpp +++ b/src/dsql/keywords.cpp @@ -62,6 +62,7 @@ static const TOK tokens[] = {AFTER, "AFTER", 1, false}, {ALL, "ALL", 1, false}, {ALTER, "ALTER", 1, false}, + {ALWAYS, "ALWAYS", 2, true}, {AND, "AND", 1, false}, {ANY, "ANY", 1, false}, {AS, "AS", 1, false}, @@ -177,6 +178,7 @@ static const TOK tokens[] = {FULL, "FULL", 1, false}, {FUNCTION, "FUNCTION", 1, false}, {GDSCODE, "GDSCODE", 1, false}, + {GENERATED, "GENERATED", 2, true}, {GENERATOR, "GENERATOR", 1, false}, {GEN_ID, "GEN_ID", 1, false}, {GEN_UUID, "GEN_UUID", 2, false}, diff --git a/src/dsql/parse.y b/src/dsql/parse.y index e1d5032c86..52719e5173 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -516,6 +516,7 @@ static LexerState lex; %token ABS %token ACCENT %token ACOS +%token ALWAYS %token ASCII_CHAR %token ASCII_VAL %token ASIN @@ -538,6 +539,7 @@ static LexerState lex; %token EXP %token FLOOR %token GEN_UUID +%token GENERATED %token GLOBAL %token HASH %token INSENSITIVE @@ -1326,7 +1328,6 @@ column_def : column_def_name data_type_or_domain domain_default_opt | column_def_name non_array_type def_computed { $$ = make_node (nod_def_field, (int) e_dfl_count, $1, NULL, NULL, NULL, NULL, NULL, $3); } - | column_def_name def_computed { $$ = make_node (nod_def_field, (int) e_dfl_count, $1, NULL, NULL, NULL, NULL, NULL, $2); } @@ -1336,12 +1337,16 @@ column_def : column_def_name data_type_or_domain domain_default_opt * source text */ -def_computed : computed_by '(' begin_trigger value end_trigger ')' +def_computed : computed_clause '(' begin_trigger value end_trigger ')' { lex.g_field->fld_flags |= FLD_computed; $$ = make_node (nod_def_computed, 2, $4, $5); } ; +computed_clause : computed_by + | GENERATED ALWAYS AS + ; + computed_by : COMPUTED BY | COMPUTED ; @@ -4744,6 +4749,7 @@ non_reserved_word : | ABS /* added in FB 2.1 */ | ACCENT | ACOS + | ALWAYS | ASCII_CHAR | ASCII_VAL | ASIN @@ -4764,6 +4770,7 @@ non_reserved_word : | EXP | FLOOR | GEN_UUID + | GENERATED | HASH | LIST | LN