From 35b74470374adf9c7e0275ae5c42e1d75d76ff70 Mon Sep 17 00:00:00 2001 From: Artyom Abakumov Date: Thu, 7 Nov 2024 12:21:10 +0300 Subject: [PATCH 1/3] Add `ALTER PACKAGE` and `CRETE OR ALTER PACKAGE` parse rules --- src/dsql/parse-conflicts.txt | 2 +- src/dsql/parse.y | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dsql/parse-conflicts.txt b/src/dsql/parse-conflicts.txt index 58be4c6e996..612edc3bcf0 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 a299f9c4b08..97db17b5345 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -863,6 +863,7 @@ using namespace Firebird; Jrd::SetDecFloatTrapsNode* setDecFloatTrapsNode; Jrd::SetBindNode* setBindNode; Jrd::SessionResetNode* sessionResetNode; + Jrd::RecreatePackageBodyNode* recreatePackageBodyNode; } %include types.y @@ -1711,6 +1712,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 +3230,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 +4302,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) From ea296c23419e65cbcf9c5857e8f73ee0d0a4ce7f Mon Sep 17 00:00:00 2001 From: Artyom Abakumov Date: Fri, 8 Nov 2024 09:03:19 +0300 Subject: [PATCH 2/3] Update README.packages.txt --- doc/sql.extensions/README.packages.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sql.extensions/README.packages.txt b/doc/sql.extensions/README.packages.txt index 20677e339e7..74ecf7cf888 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 [ ... ] From c4e92d5b45ed66c43dde282b43c54bd6f5e028f6 Mon Sep 17 00:00:00 2001 From: Artyom Abakumov Date: Fri, 8 Nov 2024 13:10:21 +0300 Subject: [PATCH 3/3] Remove unnccecery YYSTYPE --- src/dsql/parse.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dsql/parse.y b/src/dsql/parse.y index 97db17b5345..6e2c5a31fd8 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -863,7 +863,6 @@ using namespace Firebird; Jrd::SetDecFloatTrapsNode* setDecFloatTrapsNode; Jrd::SetBindNode* setBindNode; Jrd::SessionResetNode* sessionResetNode; - Jrd::RecreatePackageBodyNode* recreatePackageBodyNode; } %include types.y @@ -3230,7 +3229,7 @@ package_body_item ; -%type replace_package_body_clause +%type replace_package_body_clause replace_package_body_clause : package_body_clause { $$ = newNode($1); }