Compare commits
No commits in common. "323b17e4a926d0c24d44071497922acb7a80bd3b" and "b01c50654c6bd77cefee84dae6a4468240c89b7b" have entirely different histories.
323b17e4a9
...
b01c50654c
@ -18,7 +18,6 @@ rule read_token = parse
|
|||||||
| "SUM" { SUM }
|
| "SUM" { SUM }
|
||||||
| "COUNT" { COUNT }
|
| "COUNT" { COUNT }
|
||||||
| "DISTINCT" { DISTINCT }
|
| "DISTINCT" { DISTINCT }
|
||||||
| "SUBSTRING" { SUBSTRING }
|
|
||||||
| "FROM" { FROM }
|
| "FROM" { FROM }
|
||||||
| "INNER" { INNER }
|
| "INNER" { INNER }
|
||||||
| "LEFT" { LEFT }
|
| "LEFT" { LEFT }
|
||||||
@ -32,13 +31,13 @@ rule read_token = parse
|
|||||||
| "AND" { AND }
|
| "AND" { AND }
|
||||||
| "WHERE" { WHERE }
|
| "WHERE" { WHERE }
|
||||||
| "HAVING" { HAVING }
|
| "HAVING" { HAVING }
|
||||||
| "NOT" { NOT }
|
|
||||||
| "BETWEEN" { BETWEEN }
|
| "BETWEEN" { BETWEEN }
|
||||||
| "IN" { IN }
|
| "IN" { IN }
|
||||||
| "LIKE" { LIKE }
|
| "LIKE" { LIKE }
|
||||||
| "GROUP" { GROUP }
|
| "GROUP" { GROUP }
|
||||||
| "BY" { BY }
|
| "BY" { BY }
|
||||||
| "*" { ASTERISK }
|
| "*" { ASTERISK }
|
||||||
|
| "." { DOT }
|
||||||
| "=" { EQUALS_OPERATOR }
|
| "=" { EQUALS_OPERATOR }
|
||||||
| "(" { LEFT_PAREN }
|
| "(" { LEFT_PAREN }
|
||||||
| ")" { RIGHT_PAREN }
|
| ")" { RIGHT_PAREN }
|
||||||
@ -50,7 +49,7 @@ rule read_token = parse
|
|||||||
| ':' { COLON }
|
| ':' { COLON }
|
||||||
| whitespace { read_token lexbuf }
|
| whitespace { read_token lexbuf }
|
||||||
| digit+ as integer { INTEGER (int_of_string integer) }
|
| digit+ as integer { INTEGER (int_of_string integer) }
|
||||||
| digit+"."digit+ as number { FLOAT (float_of_string number) }
|
| digit+"."digit+ { FLOAT }
|
||||||
| '.'digit+ as number { FLOAT (float_of_string number) }
|
| '.'digit+ { FLOAT }
|
||||||
| alpha alphanumeric* as ident { IDENT ident }
|
| alpha alphanumeric* as ident { IDENT ident }
|
||||||
| eof { EOF }
|
| eof { EOF }
|
||||||
|
55
lib/ast.ml
55
lib/ast.ml
@ -2,16 +2,13 @@ type query =
|
|||||||
(*| Select of column list * table list option * filter option*)
|
(*| Select of column list * table list option * filter option*)
|
||||||
| Select of column list * table_expression
|
| Select of column list * table_expression
|
||||||
| CreateSchema of string
|
| CreateSchema of string
|
||||||
| CreateTable of table_scope option * table
|
| CreateTable of table
|
||||||
| DropSchema of string
|
| DropSchema of string
|
||||||
| DropTable of table
|
| DropTable of table
|
||||||
| DropColumn of string
|
|
||||||
and table_scope =
|
|
||||||
| Global
|
|
||||||
| Local
|
|
||||||
and column =
|
and column =
|
||||||
| Asterisk
|
| Asterisk
|
||||||
| Column of expression_primary * as_clause option
|
(* | Column of string *)
|
||||||
|
| Column of expression * as_clause option
|
||||||
and as_clause =
|
and as_clause =
|
||||||
| As of string
|
| As of string
|
||||||
and table_expression =
|
and table_expression =
|
||||||
@ -28,18 +25,19 @@ and join_type =
|
|||||||
| Union
|
| Union
|
||||||
| Natural
|
| Natural
|
||||||
and condition =
|
and condition =
|
||||||
| Condition of expression_primary * predicate
|
| Condition of predicand * predicate
|
||||||
| And of condition * condition
|
| And of condition * condition
|
||||||
| Or of condition * condition
|
| Or of condition * condition
|
||||||
| Not of condition
|
| Not of condition
|
||||||
|
and predicand = expression
|
||||||
and predicate =
|
and predicate =
|
||||||
| Comparison of operator * expression_primary
|
| Comparison of operator * predicand
|
||||||
| Between of expression_primary * expression_primary
|
| Between of predicand * predicand
|
||||||
| NotBetween of expression_primary * expression_primary
|
| NotBetween of predicand * predicand
|
||||||
| In of expression_primary list
|
| In of predicand list
|
||||||
| NotIn of expression_primary list
|
| NotIn of predicand list
|
||||||
| Like of expression_primary
|
| Like of predicand
|
||||||
| NotLike of expression_primary
|
| NotLike of predicand
|
||||||
and operator =
|
and operator =
|
||||||
| Equals
|
| Equals
|
||||||
| NotEquals
|
| NotEquals
|
||||||
@ -49,11 +47,11 @@ and operator =
|
|||||||
| GreaterEquals
|
| GreaterEquals
|
||||||
and filter = condition
|
and filter = condition
|
||||||
and group =
|
and group =
|
||||||
| Group of quantifier option * expression_primary list option
|
| Group of quantifier option * expression list option
|
||||||
and aggregate =
|
and aggregate =
|
||||||
| Aggregate of func * filter option
|
| Aggregate of func * filter option
|
||||||
and func =
|
and func =
|
||||||
| Function of function_type * quantifier option * expression_primary
|
| Function of function_type * quantifier option * expression
|
||||||
and function_type =
|
and function_type =
|
||||||
| Avg
|
| Avg
|
||||||
| Max
|
| Max
|
||||||
@ -63,22 +61,11 @@ and function_type =
|
|||||||
and quantifier =
|
and quantifier =
|
||||||
| All
|
| All
|
||||||
| Distinct
|
| Distinct
|
||||||
and expression_primary =
|
and expression =
|
||||||
| Ref of string
|
| Ref of string
|
||||||
| StringLiteral of string
|
| StringLiteral of string
|
||||||
| DateLiteral of string
|
| DateLiteral of string
|
||||||
| TimeLiteral of string
|
| TimeLiteral of string
|
||||||
| TimestampLiteral of string
|
|
||||||
| Concatenation of expression_primary * expression_primary
|
|
||||||
| Numeric of expression_primary * sign * expression_primary
|
|
||||||
| Signed of sign * expression_primary
|
|
||||||
| Substring of expression_primary * expression_primary
|
|
||||||
and sign =
|
|
||||||
| Plus
|
|
||||||
| Minus
|
|
||||||
| Times
|
|
||||||
| Divide
|
|
||||||
|
|
||||||
|
|
||||||
let rec pp_query fmt ast =
|
let rec pp_query fmt ast =
|
||||||
match ast with
|
match ast with
|
||||||
@ -99,11 +86,9 @@ and pp_column col =
|
|||||||
and pp_expression exp =
|
and pp_expression exp =
|
||||||
match exp with
|
match exp with
|
||||||
| Ref(name) -> name
|
| Ref(name) -> name
|
||||||
| StringLiteral(s) -> "'" ^ s ^ "'"
|
| StringLiteral(name) -> "'"^name^"'"
|
||||||
| DateLiteral(d) -> "'" ^ d ^ "'"
|
| DateLiteral(name) -> "'"^name^"'"
|
||||||
| TimeLiteral(t) -> "'" ^ t ^ "'"
|
| TimeLiteral(name) -> "'"^name^"'"
|
||||||
| TimestampLiteral(ts) -> "'" ^ ts ^ "'"
|
|
||||||
| _ -> "Expression not yet supported"
|
|
||||||
|
|
||||||
and pp_table_expression table_exp =
|
and pp_table_expression table_exp =
|
||||||
match table_exp with
|
match table_exp with
|
||||||
@ -152,8 +137,8 @@ and pp_predicate pred =
|
|||||||
| Comparison(op, exp) -> pp_operator op ^ pp_expression exp
|
| Comparison(op, exp) -> pp_operator op ^ pp_expression exp
|
||||||
| Between(exp1, exp2) -> "BETWEEN " ^ pp_expression exp1 ^ " AND " ^pp_expression exp2
|
| Between(exp1, exp2) -> "BETWEEN " ^ pp_expression exp1 ^ " AND " ^pp_expression exp2
|
||||||
| NotBetween(exp1, exp2) -> "NOT BETWEEN " ^ pp_expression exp1 ^ " AND " ^pp_expression exp2
|
| NotBetween(exp1, exp2) -> "NOT BETWEEN " ^ pp_expression exp1 ^ " AND " ^pp_expression exp2
|
||||||
(*| Like(exp) -> "LIKE " ^ pp_expression exp
|
| Like(exp) -> "LIKE " ^ pp_expression exp
|
||||||
| NotLike(exp) -> " NOT LIKE " ^ pp_expression exp*)
|
| NotLike(exp) -> " NOT LIKE " ^ pp_expression exp
|
||||||
| _ -> failwith "Predicate not supported"
|
| _ -> failwith "Predicate not supported"
|
||||||
|
|
||||||
and pp_operator op =
|
and pp_operator op =
|
||||||
|
@ -11,19 +11,18 @@ open Ast
|
|||||||
%token CROSS NATURAL UNION JOIN
|
%token CROSS NATURAL UNION JOIN
|
||||||
%token GREATER_THAN_OPERATOR LESS_THAN_OPERATOR EQUALS_OPERATOR
|
%token GREATER_THAN_OPERATOR LESS_THAN_OPERATOR EQUALS_OPERATOR
|
||||||
%token MAX MIN SUM COUNT AVG
|
%token MAX MIN SUM COUNT AVG
|
||||||
%token SUBSTRING
|
|
||||||
%token ASYMMETRIC SYMMETRIC
|
%token ASYMMETRIC SYMMETRIC
|
||||||
%token <string> IDENT
|
%token <string> IDENT
|
||||||
%token COMMA PIPE
|
%token COMMA DOT PIPE
|
||||||
%token LEFT_PAREN RIGHT_PAREN
|
%token LEFT_PAREN RIGHT_PAREN
|
||||||
%token ASTERISK SOLIDUS
|
%token ASTERISK
|
||||||
%token AS ON GROUP BY FILTER
|
%token AS ON GROUP BY FILTER
|
||||||
%token OR AND NOT
|
%token OR AND NOT
|
||||||
%token TRUE FALSE UNKNOWN
|
%token TRUE FALSE UNKNOWN
|
||||||
%token PLUS_SIGN MINUS_SIGN
|
%token PLUS_SIGN MINUS_SIGN
|
||||||
%token DATE TIME TIMESTAMP
|
%token DATE TIME TIMESTAMP
|
||||||
%token <int> INTEGER
|
%token <int> INTEGER
|
||||||
%token <float> FLOAT
|
%token FLOAT
|
||||||
%token UNDERSCORE QUOTE COLON
|
%token UNDERSCORE QUOTE COLON
|
||||||
%token EOF
|
%token EOF
|
||||||
%start main
|
%start main
|
||||||
@ -37,7 +36,6 @@ main:
|
|||||||
| table_definition EOF { $1 }
|
| table_definition EOF { $1 }
|
||||||
| drop_schema_statement EOF { $1 }
|
| drop_schema_statement EOF { $1 }
|
||||||
| drop_table_statement EOF { $1 }
|
| drop_table_statement EOF { $1 }
|
||||||
| drop_column_definition EOF { $1 }
|
|
||||||
|
|
||||||
(* 5.2 TOKEN / SEPARATOR *)
|
(* 5.2 TOKEN / SEPARATOR *)
|
||||||
|
|
||||||
@ -61,7 +59,7 @@ literal :
|
|||||||
| general_literal { $1 }
|
| general_literal { $1 }
|
||||||
|
|
||||||
unsigned_literal:
|
unsigned_literal:
|
||||||
(* | unsigned_numeric_literal { $1 }*)
|
(* | unsigned_numeric_literal {}*)
|
||||||
| general_literal { $1 }
|
| general_literal { $1 }
|
||||||
|
|
||||||
general_literal:
|
general_literal:
|
||||||
@ -79,15 +77,14 @@ signed_numeric_literal:
|
|||||||
| unsigned_numeric_literal {}
|
| unsigned_numeric_literal {}
|
||||||
|
|
||||||
unsigned_numeric_literal :
|
unsigned_numeric_literal :
|
||||||
| exact_numeric_literal { $1 }
|
| exact_numeric_literal {}
|
||||||
|
|
||||||
exact_numeric_literal:
|
exact_numeric_literal:
|
||||||
| FLOAT { }
|
| FLOAT {}
|
||||||
| INTEGER {}
|
|
||||||
|
|
||||||
sign:
|
sign:
|
||||||
| PLUS_SIGN { Plus }
|
| PLUS_SIGN {}
|
||||||
| MINUS_SIGN { Minus }
|
| MINUS_SIGN {}
|
||||||
|
|
||||||
unsigned_integer:
|
unsigned_integer:
|
||||||
| INTEGER { $1 }
|
| INTEGER { $1 }
|
||||||
@ -95,7 +92,7 @@ unsigned_integer:
|
|||||||
datetime_literal:
|
datetime_literal:
|
||||||
| date_literal { $1 }
|
| date_literal { $1 }
|
||||||
| time_literal { $1 }
|
| time_literal { $1 }
|
||||||
| timestamp_literal { $1 }
|
(*| timestamp_literal {}*)
|
||||||
|
|
||||||
date_literal:
|
date_literal:
|
||||||
| DATE date_string { DateLiteral($2) }
|
| DATE date_string { DateLiteral($2) }
|
||||||
@ -103,18 +100,12 @@ date_literal:
|
|||||||
time_literal:
|
time_literal:
|
||||||
| TIME time_string { TimeLiteral($2) }
|
| TIME time_string { TimeLiteral($2) }
|
||||||
|
|
||||||
timestamp_literal:
|
|
||||||
| TIMESTAMP timestamp_string { TimestampLiteral($2) }
|
|
||||||
|
|
||||||
date_string:
|
date_string:
|
||||||
| QUOTE unquoted_date_string QUOTE { $2 }
|
| QUOTE unquoted_date_string QUOTE { $2 }
|
||||||
|
|
||||||
time_string:
|
time_string:
|
||||||
| QUOTE unquoted_time_string QUOTE { $2 }
|
| QUOTE unquoted_time_string QUOTE { $2 }
|
||||||
|
|
||||||
timestamp_string:
|
|
||||||
| QUOTE unquoted_timestamp_string QUOTE { $2 }
|
|
||||||
|
|
||||||
date_value:
|
date_value:
|
||||||
| years_value MINUS_SIGN months_value MINUS_SIGN days_value { String.concat "-" [$1;$3;$5] }
|
| years_value MINUS_SIGN months_value MINUS_SIGN days_value { String.concat "-" [$1;$3;$5] }
|
||||||
|
|
||||||
@ -127,9 +118,6 @@ unquoted_date_string:
|
|||||||
unquoted_time_string:
|
unquoted_time_string:
|
||||||
| time_value { $1 }
|
| time_value { $1 }
|
||||||
|
|
||||||
unquoted_timestamp_string:
|
|
||||||
| unquoted_date_string unquoted_time_string { $1 ^ " " ^$2 }
|
|
||||||
|
|
||||||
years_value :
|
years_value :
|
||||||
| datetime_value { $1 }
|
| datetime_value { $1 }
|
||||||
|
|
||||||
@ -166,6 +154,10 @@ schema_name:
|
|||||||
|
|
||||||
(****************************)
|
(****************************)
|
||||||
|
|
||||||
|
character_value_expression:
|
||||||
|
(* | concatenation {} *)
|
||||||
|
| character_factor { $1 }
|
||||||
|
|
||||||
|
|
||||||
(* 6. SCALAR EXPRESSION *)
|
(* 6. SCALAR EXPRESSION *)
|
||||||
|
|
||||||
@ -179,7 +171,6 @@ parenthesized_value_expression:
|
|||||||
| LEFT_PAREN value_expression RIGHT_PAREN { $2 }
|
| LEFT_PAREN value_expression RIGHT_PAREN { $2 }
|
||||||
|
|
||||||
nonparenthesized_value_expression_primary:
|
nonparenthesized_value_expression_primary:
|
||||||
(* Return StringLiteral, TimeLiteral, DateLiteral, TimestampLiteral *)
|
|
||||||
| unsigned_value_specification { $1 }
|
| unsigned_value_specification { $1 }
|
||||||
| column_reference { Ref($1) }
|
| column_reference { Ref($1) }
|
||||||
| set_function_specification { Ref("function") }
|
| set_function_specification { Ref("function") }
|
||||||
@ -227,70 +218,29 @@ set_function_specification:
|
|||||||
|
|
||||||
value_expression:
|
value_expression:
|
||||||
| common_value_expression { $1 }
|
| common_value_expression { $1 }
|
||||||
(*| boolean_value_expression { $1 }*)
|
|
||||||
|
|
||||||
(* To avoid cycles and therefore reduce/reduce conflicts
|
|
||||||
instead of having all *_value_expression below,
|
|
||||||
they are cascaded :
|
|
||||||
numeric_value_expression -> string_value_expression
|
|
||||||
-> datetime_value_expression -> reference_value_expression
|
|
||||||
in the last step of the *_value_expression preceding
|
|
||||||
instead of value_expression_primary
|
|
||||||
|
|
||||||
This way the parser covers all of them every time, and
|
|
||||||
prevent reduce/reduce conflicts *)
|
|
||||||
common_value_expression:
|
common_value_expression:
|
||||||
| numeric_value_expression { $1 }
|
(*| numeric_value_expression {}*)
|
||||||
(* | string_value_expression { $1 } *)
|
(*| string_value_expression {} *)
|
||||||
(* | datetime_value_expression { $1 } *)
|
| reference_value_expression { $1 }
|
||||||
(* | reference_value_expression { $1 }*)
|
|
||||||
|
|
||||||
reference_value_expression:
|
reference_value_expression:
|
||||||
| value_expression_primary { $1 }
|
| value_expression_primary { $1 }
|
||||||
|
|
||||||
(*************************)
|
(*************************)
|
||||||
|
|
||||||
(* 6.26 NUMERIC VALUE EXPRESSION *)
|
|
||||||
|
|
||||||
numeric_value_expression:
|
|
||||||
| term { $1 }
|
|
||||||
| numeric_value_expression PLUS_SIGN term { Numeric($1, Plus, $3) }
|
|
||||||
| numeric_value_expression MINUS_SIGN term { Numeric($1, Minus, $3) }
|
|
||||||
|
|
||||||
term:
|
|
||||||
| factor { $1 }
|
|
||||||
| term ASTERISK factor { Numeric($1, Times, $3) }
|
|
||||||
| term SOLIDUS factor { Numeric($1, Divide, $3) }
|
|
||||||
|
|
||||||
factor:
|
|
||||||
| numeric_primary { $1 }
|
|
||||||
| sign numeric_primary { Signed($1, $2) }
|
|
||||||
|
|
||||||
numeric_primary:
|
|
||||||
| string_value_expression { $1 }
|
|
||||||
(* | value_expression_primary { $1 }*)
|
|
||||||
|
|
||||||
(*********************************)
|
|
||||||
|
|
||||||
(* 6.28 STRING VALUE EXPRESSION *)
|
(* 6.28 STRING VALUE EXPRESSION *)
|
||||||
|
|
||||||
string_value_expression :
|
string_value_expression :
|
||||||
| character_value_expression { $1 }
|
| character_value_expression { $1 }
|
||||||
(* | blob_value_expression {} *)
|
(* | blob_value_expression {} *)
|
||||||
|
|
||||||
character_value_expression:
|
|
||||||
(* Return Concatenation of char_expression * expression_primary *)
|
|
||||||
| concatenation { $1 }
|
|
||||||
(* Return Char of string *)
|
|
||||||
| character_factor { $1 }
|
|
||||||
|
|
||||||
character_primary:
|
character_primary:
|
||||||
| datetime_value_expression { $1 }
|
| value_expression_primary { $1 }
|
||||||
(* | value_expression_primary { $1 }*)
|
(* | string_value_function {} *)
|
||||||
| string_value_function { $1 }
|
|
||||||
|
|
||||||
concatenation:
|
concatenation:
|
||||||
| character_value_expression concatenation_operator character_factor { Concatenation($1, $3) }
|
| character_value_expression concatenation_operator character_factor {}
|
||||||
|
|
||||||
character_factor :
|
character_factor :
|
||||||
| character_primary { $1 }
|
| character_primary { $1 }
|
||||||
@ -300,39 +250,13 @@ character_factor :
|
|||||||
(* 6.29 STRING VALUE FUNCTION *)
|
(* 6.29 STRING VALUE FUNCTION *)
|
||||||
|
|
||||||
string_value_function:
|
string_value_function:
|
||||||
| character_value_function { $1 }
|
| character_value_function {}
|
||||||
|
|
||||||
character_value_function :
|
character_value_function :
|
||||||
| character_substring_function { $1 }
|
| {}
|
||||||
|
|
||||||
character_substring_function :
|
|
||||||
| SUBSTRING LEFT_PAREN character_value_expression FROM start_position RIGHT_PAREN { Substring($3, $5) }
|
|
||||||
|
|
||||||
start_position:
|
|
||||||
| numeric_value_expression { $1 }
|
|
||||||
(*************************)
|
(*************************)
|
||||||
|
|
||||||
(* 6.30 DATETIME VALUE EXPRESSION *)
|
|
||||||
|
|
||||||
datetime_value_expression:
|
|
||||||
| datetime_term { $1 }
|
|
||||||
|
|
||||||
datetime_term :
|
|
||||||
| datetime_factor { $1 }
|
|
||||||
|
|
||||||
datetime_factor:
|
|
||||||
| datetime_primary { $1 }
|
|
||||||
|
|
||||||
datetime_primary:
|
|
||||||
| reference_value_expression { $1 }
|
|
||||||
(* | datetime_value_function { $1 }*)
|
|
||||||
|
|
||||||
(**********************************)
|
|
||||||
|
|
||||||
(* 6.31 DATETIME VALUE FUCTION *)
|
|
||||||
|
|
||||||
(*******************************)
|
|
||||||
|
|
||||||
(* 6.34 BOOLEAN VALUE EXPRESSION *)
|
(* 6.34 BOOLEAN VALUE EXPRESSION *)
|
||||||
|
|
||||||
boolean_value_expression:
|
boolean_value_expression:
|
||||||
@ -406,11 +330,11 @@ table_expression:
|
|||||||
| from_clause { TableExpression(Some($1), None, None) }
|
| from_clause { TableExpression(Some($1), None, None) }
|
||||||
| from_clause where_clause { TableExpression(Some($1), Some($2), None) }
|
| from_clause where_clause { TableExpression(Some($1), Some($2), None) }
|
||||||
| from_clause where_clause group_by_clause { TableExpression(Some($1), Some($2), Some($3)) }
|
| from_clause where_clause group_by_clause { TableExpression(Some($1), Some($2), Some($3)) }
|
||||||
| from_clause where_clause group_by_clause having_clause { TableExpression(Some($1), Some($2), Some($3)) }
|
(* | from_clause where_clause group_by_clause having_clause { Some($1) }
|
||||||
| from_clause where_clause having_clause { TableExpression(Some($1), Some($2), None) }
|
| from_clause group_by_clause { Some($1) }
|
||||||
| from_clause group_by_clause { TableExpression(Some($1), None, Some($2)) }
|
| from_clause group_by_clause having_clause { Some($1) }
|
||||||
| from_clause group_by_clause having_clause { TableExpression(Some($1), None, Some($2)) }
|
| from_clause having_clause { Some($1) }
|
||||||
| from_clause having_clause { TableExpression(Some($1), None, None) }
|
*)
|
||||||
|
|
||||||
(************************)
|
(************************)
|
||||||
|
|
||||||
@ -560,17 +484,15 @@ select_sublist_element :
|
|||||||
| derived_column { $1 }
|
| derived_column { $1 }
|
||||||
(* | qualified_asterisk {} *)
|
(* | qualified_asterisk {} *)
|
||||||
|
|
||||||
(*
|
|
||||||
qualified_asterisk:
|
qualified_asterisk:
|
||||||
| asterisked_identifier_chain DOT ASTERISK {}
|
| asterisked_identifier_chain {}
|
||||||
|
|
||||||
asterisked_identifier_chain:
|
asterisked_identifier_chain:
|
||||||
| asterisked_identifier {}
|
| asterisked_identifier {}
|
||||||
| asterisked_identifier_chain DOT asterisked_identifier {}
|
| asterisked_identifier_chain DOT asterisked_identifier {}
|
||||||
|
|
||||||
asterisked_identifier :
|
asterisked_identifier :
|
||||||
| ASTERISK {}
|
| IDENT {}
|
||||||
*)
|
|
||||||
|
|
||||||
derived_column:
|
derived_column:
|
||||||
| value_expression { Column($1, None) }
|
| value_expression { Column($1, None) }
|
||||||
@ -744,23 +666,22 @@ drop_schema_statement:
|
|||||||
(* 11.3 TABLE DEFINITION *)
|
(* 11.3 TABLE DEFINITION *)
|
||||||
|
|
||||||
table_definition :
|
table_definition :
|
||||||
| CREATE TABLE table_name { CreateTable(None, $3) }
|
| CREATE TABLE table_name { CreateTable($3) }
|
||||||
| CREATE table_scope TABLE table_name { CreateTable(Some($2), $4) }
|
|
||||||
|
|
||||||
table_scope :
|
table_scope :
|
||||||
| global_or_local TEMPORARY { $1 }
|
| global_or_local TEMPORARY {}
|
||||||
|
|
||||||
global_or_local :
|
global_or_local :
|
||||||
| GLOBAL { Global }
|
| GLOBAL {}
|
||||||
| LOCAL { Local }
|
| LOCAL {}
|
||||||
|
|
||||||
(*************************)
|
(*************************)
|
||||||
|
|
||||||
(* 11.18 DROP COLUMN DEFINITION *)
|
(* 11.18 DROP COLUMN DEFINITION *)
|
||||||
|
|
||||||
drop_column_definition:
|
drop_column_definition:
|
||||||
| DROP column_name { DropColumn($2) }
|
| DROP column_name {}
|
||||||
| DROP COLUMN column_name { DropColumn($3) }
|
| DROP COLUMN column_name {}
|
||||||
|
|
||||||
(********************************)
|
(********************************)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user