From 38e7f17779a5af09046afae3e325dcc943302313 Mon Sep 17 00:00:00 2001 From: vasilevskyy Date: Tue, 20 Aug 2024 11:11:32 +0300 Subject: [PATCH 1/3] FIX S091 (need finish) --- .../src/main/antlr4/imports/firebird/BaseRule.g4 | 11 ++++++++++- .../main/antlr4/imports/firebird/FirebirdKeyword.g4 | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 index 539dd685a1b14..aeebe91006d98 100644 --- a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 +++ b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 @@ -306,7 +306,7 @@ dataType dataTypeName : CHARACTER | CHARACTER VARYING | CHAR VARYING | NATIONAL CHARACTER | NATIONAL CHARACTER VARYING | CHAR | VARCHAR | NCHAR | NATIONAL CHAR | NATIONAL CHAR VARYING | BIT | BIT VARYING | NUMERIC | DECIMAL | DEC | INTEGER | SMALLINT | BOOLEAN - | FLOAT | REAL | DOUBLE PRECISION | DATE | TIME | TIMESTAMP | INTERVAL | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE + | FLOAT | REAL | DOUBLE PRECISION | DATE | TIME | TIMESTAMP | INTERVAL | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | array | identifier ; @@ -329,3 +329,12 @@ ignoredIdentifier dropBehaviour : (CASCADE | RESTRICT)? ; + +array + : (SMALLINT | INTEGER | BIGINT) LBT_ arrayDimension RBT_? + ; + +arrayDimension + : LBT_ ((NUMBER_ COLON_)? NUMBER_ RBT_) (COMMA_ LBT_ ((NUMBER_ COLON_)? NUMBER_ RBT_))* + | NUMBER_ (COMMA_ NUMBER_)* + ; \ No newline at end of file diff --git a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/FirebirdKeyword.g4 b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/FirebirdKeyword.g4 index 88999220b97a5..723529ccdbf3b 100644 --- a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/FirebirdKeyword.g4 +++ b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/FirebirdKeyword.g4 @@ -711,6 +711,9 @@ ROW : R O W ; +BIGINT + : B I G I N T + ; //PASSWORD // : P A S S W O R D From 10921617b0cda523a3bff14a8772f98397e5d031 Mon Sep 17 00:00:00 2001 From: vasilevskyy Date: Tue, 20 Aug 2024 11:20:09 +0300 Subject: [PATCH 2/3] correct --- .../firebird/src/main/antlr4/imports/firebird/BaseRule.g4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 index aeebe91006d98..56eff3c441d15 100644 --- a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 +++ b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 @@ -331,7 +331,7 @@ dropBehaviour ; array - : (SMALLINT | INTEGER | BIGINT) LBT_ arrayDimension RBT_? + : (SMALLINT | INTEGER | BIGINT) LBT_ arrayDimension RBT_ ; arrayDimension From 525dd5e1f65cc70dff2f4fdefdc9ee1b120f44a7 Mon Sep 17 00:00:00 2001 From: vasilevskyy Date: Thu, 5 Sep 2024 11:40:21 +0300 Subject: [PATCH 3/3] correct --- .../firebird/src/main/antlr4/imports/firebird/BaseRule.g4 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 index 56eff3c441d15..1df5aca695065 100644 --- a/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 +++ b/parser/sql/dialect/firebird/src/main/antlr4/imports/firebird/BaseRule.g4 @@ -301,12 +301,13 @@ orderByItem dataType : dataTypeName dataTypeLength? characterSet? collateClause? | dataTypeName LP_ STRING_ (COMMA_ STRING_)* RP_ characterSet? collateClause? + | (SMALLINT | INTEGER | BIGINT) LBT_ arrayDimension RBT_ ; dataTypeName : CHARACTER | CHARACTER VARYING | CHAR VARYING | NATIONAL CHARACTER | NATIONAL CHARACTER VARYING | CHAR | VARCHAR | NCHAR | NATIONAL CHAR | NATIONAL CHAR VARYING | BIT | BIT VARYING | NUMERIC | DECIMAL | DEC | INTEGER | SMALLINT | BOOLEAN - | FLOAT | REAL | DOUBLE PRECISION | DATE | TIME | TIMESTAMP | INTERVAL | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | array + | FLOAT | REAL | DOUBLE PRECISION | DATE | TIME | TIMESTAMP | INTERVAL | TIME WITH TIME ZONE | TIMESTAMP WITH TIME ZONE | identifier ; @@ -330,10 +331,6 @@ dropBehaviour : (CASCADE | RESTRICT)? ; -array - : (SMALLINT | INTEGER | BIGINT) LBT_ arrayDimension RBT_ - ; - arrayDimension : LBT_ ((NUMBER_ COLON_)? NUMBER_ RBT_) (COMMA_ LBT_ ((NUMBER_ COLON_)? NUMBER_ RBT_))* | NUMBER_ (COMMA_ NUMBER_)*