You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/21 11:48:24 UTC

[GitHub] [shardingsphere] Icesource commented on a change in pull request #12435: Proofread the SQLServer syntax of trigger, sequence and index

Icesource commented on a change in pull request #12435:
URL: https://github.com/apache/shardingsphere/pull/12435#discussion_r712959855



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DDLStatement.g4
##########
@@ -678,3 +694,97 @@ withCommonTableExpr
 commonTableExpr
     : name (LP_ columnName (COMMA_ columnName)* RP_)? AS LP_ select RP_
     ;
+
+createTriggerClause
+    : (WITH dmlTriggerOption COMMA_ dmlTriggerOption)? (FOR | AFTER | INSTEAD OF)
+    INSERT? COMMA_? UPDATE? COMMA_? DELETE? COMMA_? (WITH APPEND)? (NOT FOR REPLICATION)?
+    AS (compoundStatement | EXTERNAL NAME methodSpecifier)
+    ;
+
+dmlTriggerOption
+    : ENCRYPTION | executeAsClause | NATIVE_COMPILATION | SCHEMABINDING |
+    ;
+
+methodSpecifier
+    : name DOT_ name DOT_ name
+    ;
+
+triggerTarget
+    : tableName | viewName | ALL SERVER | DATABASE
+    ;
+
+createOrAlterSequenceClause
+    : AS dataType
+    | (START | RESTART) WITH expr
+    | INCREMENT BY expr
+    | MINVALUE expr? | NO MINVALUE
+    | MAXVALUE expr? | NO MAXVALUE
+    | CACHE expr | NO CACHE
+    | NO? CYCLE
+    ;
+
+createIndexClause
+    : (INCLUDE columnNamesWithSort)? (WHERE filterPredicate)? (WITH relationalIndexOption (COMMA_ relationalIndexOption)*)?
+    (ON (schemaName LP_ columnName RP_ | name))? (FILESTREAM_ON (name | stringLiterals))?
+    ;
+
+filterPredicate
+    : conjunct (AND conjunct)*
+    ;
+
+conjunct
+    : columnName IN LP_ expr (COMMA_ expr)* RP_
+    | columnName comparisonOperator expr
+    ;
+
+alterIndexClause
+    : REBUILD (PARTITION EQ_ (ALL | expr))? (WITH LP_ relationalIndexOption (COMMA_ relationalIndexOption)* RP_)?
+    | DISABLE
+    | REORGANIZE (PARTITION EQ_ expr)? (WITH LP_ reorganizeOption RP_)?
+    | SET LP_ setIndexOption (COMMA_ setIndexOption) RP_
+    | RESUME (WITH LP_ resumableIndexOptions (COMMA_ resumableIndexOptions)* RP_)?
+    | PAUSE
+    | ABORT
+    ;
+
+relationalIndexOption
+    : PAD_INDEX EQ_ (ON | OFF)
+    | FILLFACTOR EQ_ expr
+    | SORT_IN_TEMPDB EQ_ (ON | OFF)
+    | IGNORE_DUP_KEY EQ_ (ON | OFF)
+    | STATISTICS_NORECOMPUTE EQ_ (ON | OFF)
+    | STATISTICS_INCREMENTAL EQ_ (ON | OFF)
+    | DROP_EXISTING EQ_ (ON | OFF)
+    | ONLINE EQ_ (ON lowPriorityLockWait? | OFF)
+    | RESUMABLE EQ_ (ON | OFF)
+    | MAX_DURATION EQ_ expr MINUTES?
+    | ALLOW_ROW_LOCKS EQ_ (ON | OFF)
+    | ALLOW_PAGE_LOCKS EQ_ (ON | OFF)
+    | OPTIMIZE_FOR_SEQUENTIAL_KEY EQ_ (ON | OFF)
+    | MAXDOP EQ_ expr
+    | DATA_COMPRESSION EQ_ (NONE | ROW | PAGE | COLUMNSTORE | COLUMNSTORE_ARCHIVE) (ON PARTITIONS LP_ partitionNumberRange (COMMA_ partitionNumberRange)*)?
+    ;
+
+partitionNumberRange
+    : partitionNumber (TO partitionNumber)?
+    ;

Review comment:
       @jingshanglu  done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org