From 3c5d29511136c20c67118a3d0858f54318f2eba3 Mon Sep 17 00:00:00 2001 From: Daehyun Kim Date: Mon, 9 Dec 2024 17:46:28 +0900 Subject: [PATCH] feat(csql_grammar.y): can create vector table with arguments --- src/parser/csql_grammar.y | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/parser/csql_grammar.y b/src/parser/csql_grammar.y index 7e8ab17879..4d21c90aad 100644 --- a/src/parser/csql_grammar.y +++ b/src/parser/csql_grammar.y @@ -1093,6 +1093,7 @@ static char *g_plcsql_text; %type class_name_with_server_name %type opt_index_with_clause %type index_with_item_list +%type opt_vector_args /*}}}*/ @@ -21890,7 +21891,7 @@ primitive_type $$ = ctn; DBG_PRINT}} - | VECTOR + | VECTOR opt_vector_args {{ DBG_TRACE_GRAMMAR(data_type, | vector_type); container_2 ctn; @@ -21900,6 +21901,37 @@ primitive_type DBG_PRINT}} ; +opt_vector_args + : /* empty */ + {{ DBG_TRACE_GRAMMAR(opt_vector_args, : ); + + container_2 ctn; + SET_CONTAINER_2 (ctn, NULL, NULL); + $$ = ctn; + + DBG_PRINT}} + | '(' unsigned_integer ')' + {{ DBG_TRACE_GRAMMAR(opt_vector_args, | '(' unsigned_integer ')' ); + + container_2 ctn; + SET_CONTAINER_2 (ctn, $2, NULL); + $$ = ctn; + + DBG_PRINT}} + | '(' unsigned_integer ',' primitive_type ')' + {{ DBG_TRACE_GRAMMAR(opt_vector_args, | '(' unsigned_integer ',' primitive_type ')' ); + + container_2 ctn; + // TODO: primitive_type not yet handled. + container_2 primitive_type_container = $4; + + SET_CONTAINER_2 (ctn, $2, NULL); + $$ = ctn; + + DBG_PRINT}} + ; + + opt_internal_external : /* empty */ {{ DBG_TRACE_GRAMMAR(opt_internal_external, : );