From 52657ab69181a8aa759287f422351e4b671c766e Mon Sep 17 00:00:00 2001 From: Artyom Abakumov Date: Fri, 8 Nov 2024 14:18:11 +0300 Subject: [PATCH] Add `ALTER PACKAGE BODY` and `CRETE OR ALTER PACKAGE BODY` parse rules (#8309) --- doc/sql.extensions/README.packages.txt | 2 +- src/dsql/parse-conflicts.txt | 2 +- src/dsql/parse.y | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/sql.extensions/README.packages.txt b/doc/sql.extensions/README.packages.txt index 20677e339e..74ecf7cf88 100644 --- a/doc/sql.extensions/README.packages.txt +++ b/doc/sql.extensions/README.packages.txt @@ -28,7 +28,7 @@ Syntax: PROCEDURE [( ) [RETURNS ( )]] ::= - { CREATE | RECREATE } PACKAGE BODY + { CREATE [OR ALTER] | ALTER | RECREATE } PACKAGE BODY AS BEGIN [ ... ] diff --git a/src/dsql/parse-conflicts.txt b/src/dsql/parse-conflicts.txt index 58be4c6e99..612edc3bcf 100644 --- a/src/dsql/parse-conflicts.txt +++ b/src/dsql/parse-conflicts.txt @@ -1 +1 @@ -115 shift/reduce conflicts, 22 reduce/reduce conflicts. +117 shift/reduce conflicts, 22 reduce/reduce conflicts. diff --git a/src/dsql/parse.y b/src/dsql/parse.y index a299f9c4b0..6e2c5a31fd 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -1711,6 +1711,7 @@ replace_clause | FUNCTION replace_function_clause { $$ = $2; } | TRIGGER replace_trigger_clause { $$ = $2; } | PACKAGE replace_package_clause { $$ = $2; } + | PACKAGE BODY replace_package_body_clause { $$ = $3; } | VIEW replace_view_clause { $$ = $2; } | EXCEPTION replace_exception_clause { $$ = $2; } | GENERATOR replace_sequence_clause { $$ = $2; } @@ -3228,6 +3229,12 @@ package_body_item ; +%type replace_package_body_clause +replace_package_body_clause + : package_body_clause + { $$ = newNode($1); } + ; + %type local_declarations_opt local_declarations_opt : local_forward_declarations_opt local_nonforward_declarations_opt @@ -4294,6 +4301,7 @@ alter_clause | TRIGGER alter_trigger_clause { $$ = $2; } | PROCEDURE alter_procedure_clause { $$ = $2; } | PACKAGE alter_package_clause { $$ = $2; } + | PACKAGE BODY replace_package_body_clause { $$ = $3; } | DATABASE { $$ = newNode(); } alter_db($2)