Skip to content

Commit 5f172d2

Browse files
committed
fixed alter table - type is not required.
1 parent 24c8e81 commit 5f172d2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/parser/antlr4/ClickHouseParser.g4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ alterTableClause
8484
| MODIFY COLUMN (IF EXISTS)? nestedIdentifier COMMENT STRING_LITERAL # AlterTableClauseModifyComment
8585
| MODIFY COLUMN (IF EXISTS)? nestedIdentifier REMOVE tableColumnPropertyType # AlterTableClauseModifyRemove
8686
| MODIFY COLUMN (IF EXISTS)? tableColumnDfnt # AlterTableClauseModify
87-
| ALTER COLUMN (IF EXISTS)? identifier TYPE columnTypeExpr codecExpr? ttlClause? settingExprList? alterTableColumnPosition? # AlterTableClauseAlterType
87+
| ALTER COLUMN (IF EXISTS)? identifier TYPE? columnTypeExpr codecExpr? ttlClause? settingExprList? alterTableColumnPosition? # AlterTableClauseAlterType
8888
| MODIFY ORDER BY columnExpr # AlterTableClauseModifyOrderBy
8989
| MODIFY ttlClause # AlterTableClauseModifyTTL
9090
| MODIFY COMMENT literal # AlterTableClauseModifyComment
@@ -662,7 +662,7 @@ exchangeStmt
662662
// SET statement
663663

664664
setStmt
665-
: SET IDENTIFIER EQ_SINGLE literal
665+
: SET (identifier | settingExpr)
666666
;
667667

668668
// SET ROLE statement

jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ public static Object[][] testStatementWithoutResultSetDP() {
636636
{"EXCHANGE DICTIONARIES dict1 AND dict2", 0, false},
637637
{"EXCHANGE DICTIONARIES dict1 AND dict2 ON CLUSTER `default`", 0, false},
638638
{"SET profile = 'profile-name-from-the-settings-file'", 0, false},
639+
{"SET setting_1 = 'some value'", 0, false},
639640
{"SET use_some_feature_flag", 0, false},
640641
{"SET use_some_feature_flag = 'true'", 0, false},
641642
{"SET ROLE role1", 0, false},

0 commit comments

Comments
 (0)