Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
67829ee4
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
67829ee4
编写于
8月 02, 2019
作者:
L
Liang Zhang
提交者:
GitHub
8月 02, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2799 from jingshanglu/dev
add mysql grammar support for srs and trigger
上级
3e1f2fca
0748ef94
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
120 addition
and
52 deletion
+120
-52
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
...ore-parse-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
+2
-1
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
...parse-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
+34
-0
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/Keyword.g4
...core-parse-mysql/src/main/antlr4/imports/mysql/Keyword.g4
+4
-12
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/MySQLKeyword.g4
...parse-mysql/src/main/antlr4/imports/mysql/MySQLKeyword.g4
+47
-0
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
...e-parse-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
+1
-1
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/Keyword.g4
...re-parse-oracle/src/main/antlr4/imports/oracle/Keyword.g4
+4
-12
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
...se-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
+4
-0
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
...postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
+2
-1
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/Keyword.g4
...-postgresql/src/main/antlr4/imports/postgresql/Keyword.g4
+4
-12
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
...l/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
+8
-0
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
...e-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
+2
-1
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/Keyword.g4
...se-sqlserver/src/main/antlr4/imports/sqlserver/Keyword.g4
+4
-12
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
...ver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
+4
-0
未找到文件。
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
浏览文件 @
67829ee4
...
@@ -102,7 +102,8 @@ unreservedWord_
...
@@ -102,7 +102,8 @@ unreservedWord_
| SCHEDULE | COMPLETION | DO | DEFINER | START | EVERY | HOST | SOCKET | OWNER | PORT | RETURNS | CONTAINS
| SCHEDULE | COMPLETION | DO | DEFINER | START | EVERY | HOST | SOCKET | OWNER | PORT | RETURNS | CONTAINS
| SECURITY | INVOKER | UNDEFINED | MERGE | TEMPTABLE | CASCADED | LOCAL | SERVER | WRAPPER | OPTIONS | DATAFILE
| SECURITY | INVOKER | UNDEFINED | MERGE | TEMPTABLE | CASCADED | LOCAL | SERVER | WRAPPER | OPTIONS | DATAFILE
| FILE_BLOCK_SIZE | EXTENT_SIZE | INITIAL_SIZE | AUTOEXTEND_SIZE | MAX_SIZE | NODEGROUP
| FILE_BLOCK_SIZE | EXTENT_SIZE | INITIAL_SIZE | AUTOEXTEND_SIZE | MAX_SIZE | NODEGROUP
| WAIT | LOGFILE | UNDOFILE | UNDO_BUFFER_SIZE | REDO_BUFFER_SIZE
| WAIT | LOGFILE | UNDOFILE | UNDO_BUFFER_SIZE | REDO_BUFFER_SIZE | DEFINITION | ORGANIZATION
| DESCRIPTION | REFERENCE | FOLLOWS | PRECEDES
;
;
schemaName
schemaName
...
...
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
浏览文件 @
67829ee4
...
@@ -39,6 +39,11 @@ dropTable
...
@@ -39,6 +39,11 @@ dropTable
: DROP dropTableSpecification_ TABLE tableExistClause_ tableNames
: DROP dropTableSpecification_ TABLE tableExistClause_ tableNames
;
;
renameTable
: RENAME TABLE
(tableName TO tableName) (COMMA_ tableName TO tableName)*
;
dropIndex
dropIndex
: DROP INDEX dropIndexSpecification_? indexName (ON tableName)?
: DROP INDEX dropIndexSpecification_? indexName (ON tableName)?
(
(
...
@@ -227,6 +232,28 @@ dropLogfileGroup
...
@@ -227,6 +232,28 @@ dropLogfileGroup
: DROP LOGFILE GROUP identifier_ ENGINE EQ_ identifier_
: DROP LOGFILE GROUP identifier_ ENGINE EQ_ identifier_
;
;
createSpatialReferenceSystem
: CREATE (OR REPLACE)? SPATIAL REFERENCE SYSTEM (IF NOT EXISTS)? numberLiterals srsOption_*
;
dropSpatialReferenceSystem
: DROP SPATIAL REFERENCE SYSTEM (IF EXISTS)? numberLiterals
;
createTrigger
: CREATE ownerStatement?
TRIGGER identifier_
(BEFORE | AFTER)
(INSERT | UPDATE | DELETE)
ON tableName FOR EACH ROW
((FOLLOWS | PRECEDES) identifier_)?
routineBody
;
dropTrigger
: DROP TRIGGER (IF EXISTS)? (owner DOT_)? identifier_
;
createTableSpecification_
createTableSpecification_
: TEMPORARY
: TEMPORARY
;
;
...
@@ -569,3 +596,10 @@ procedureParameter_
...
@@ -569,3 +596,10 @@ procedureParameter_
fileSizeLiteral_
fileSizeLiteral_
: numberLiterals ('K'|'M'|'G'|'T') | numberLiterals
: numberLiterals ('K'|'M'|'G'|'T') | numberLiterals
;
;
srsOption_
: NAME STRING_
| DEFINITION STRING_*
| ORGANIZATION STRING_ IDENTIFIED BY numberLiterals
| DESCRIPTION STRING_
;
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/Keyword.g4
浏览文件 @
67829ee4
...
@@ -463,22 +463,10 @@ CALL
...
@@ -463,22 +463,10 @@ CALL
: C A L L
: C A L L
;
;
INSTANCE
: I N S T A N C E
;
PRESERVE
PRESERVE
: P R E S E R V E
: P R E S E R V E
;
;
DO
: D O
;
DEFINER
: D E F I N E R
;
CURRENT_USER
CURRENT_USER
: C U R R E N T UL_ U S E R
: C U R R E N T UL_ U S E R
;
;
...
@@ -495,3 +483,7 @@ CASCADED
...
@@ -495,3 +483,7 @@ CASCADED
LOCAL
LOCAL
: L O C A L
: L O C A L
;
;
NAME
: N A M E
;
sharding-core/sharding-core-parse/sharding-core-parse-mysql/src/main/antlr4/imports/mysql/MySQLKeyword.g4
浏览文件 @
67829ee4
...
@@ -1120,3 +1120,50 @@ REDO_BUFFER_SIZE
...
@@ -1120,3 +1120,50 @@ REDO_BUFFER_SIZE
: R E D O UL_ B U F F E R UL_ S I Z E
: R E D O UL_ B U F F E R UL_ S I Z E
;
;
DEFINITION
: D E F I N I T I O N
;
ORGANIZATION
: O R G A N I Z A T I O N
;
DESCRIPTION
: D E S C R I P T I O N
;
REFERENCE
: R E F E R E N C E
;
SYSTEM
: S Y S T E M
;
FOLLOWS
: F O L L O W S
;
PRECEDES
: P R E C E D E S
;
BEFORE
: B E F O R E
;
EACH
: E A C H
;
DEFINER
: D E F I N E R
;
DO
: D O
;
INSTANCE
: I N S T A N C E
;
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
浏览文件 @
67829ee4
...
@@ -95,7 +95,7 @@ unreservedWord_
...
@@ -95,7 +95,7 @@ unreservedWord_
| CONTAINER | SEGMENT | RESTRICTED | COST | SYNONYM | BACKUP | UNLIMITED
| CONTAINER | SEGMENT | RESTRICTED | COST | SYNONYM | BACKUP | UNLIMITED
| BECOME | CHANGE | NOTIFICATION | ACCESS | PRIVILEGE | PURGE | RESUMABLE
| BECOME | CHANGE | NOTIFICATION | ACCESS | PRIVILEGE | PURGE | RESUMABLE
| SYSGUID | SYSBACKUP | SYSDBA | SYSDG | SYSKM | SYSOPER | DBA_RECYCLEBIN |SCHEMA
| SYSGUID | SYSBACKUP | SYSDBA | SYSDG | SYSKM | SYSOPER | DBA_RECYCLEBIN |SCHEMA
|
DO | DEFINER | CURRENT_USER | CASCADED
|
CURRENT_USER | CASCADED | NAME
;
;
schemaName
schemaName
...
...
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/Keyword.g4
浏览文件 @
67829ee4
...
@@ -463,22 +463,10 @@ CALL
...
@@ -463,22 +463,10 @@ CALL
: C A L L
: C A L L
;
;
INSTANCE
: I N S T A N C E
;
PRESERVE
PRESERVE
: P R E S E R V E
: P R E S E R V E
;
;
DO
: D O
;
DEFINER
: D E F I N E R
;
CURRENT_USER
CURRENT_USER
: C U R R E N T UL_ U S E R
: C U R R E N T UL_ U S E R
;
;
...
@@ -494,3 +482,7 @@ CASCADED
...
@@ -494,3 +482,7 @@ CASCADED
LOCAL
LOCAL
: L O C A L
: L O C A L
;
;
NAME
: N A M E
;
sharding-core/sharding-core-parse/sharding-core-parse-oracle/src/main/antlr4/imports/oracle/OracleKeyword.g4
浏览文件 @
67829ee4
...
@@ -674,3 +674,7 @@ SYSOPER
...
@@ -674,3 +674,7 @@ SYSOPER
DBA_RECYCLEBIN
DBA_RECYCLEBIN
: D B A UL_ R E C Y C L E B I N
: D B A UL_ R E C Y C L E B I N
;
;
INSTANCE
: I N S T A N C E
;
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/BaseRule.g4
浏览文件 @
67829ee4
...
@@ -91,7 +91,8 @@ unreservedWord_
...
@@ -91,7 +91,8 @@ unreservedWord_
| SEQUENCE | SESSION | SHOW | SIMPLE | STATISTICS | STORAGE | TABLESPACE
| SEQUENCE | SESSION | SHOW | SIMPLE | STATISTICS | STORAGE | TABLESPACE
| TEMP | TEMPORARY | TRIGGER | TYPE | UNBOUNDED | UNLOGGED | UPDATE
| TEMP | TEMPORARY | TRIGGER | TYPE | UNBOUNDED | UNLOGGED | UPDATE
| USAGE | VALID | VALIDATE | WITHIN | WITHOUT | ZONE | GROUPS
| USAGE | VALID | VALIDATE | WITHIN | WITHOUT | ZONE | GROUPS
| RECURSIVE | INSTANCE | DEFINER | PRESERVE | SQL | LOCAL | CASCADED
| RECURSIVE | INSTANCE | PRESERVE | SQL | LOCAL | CASCADED
| NAME
;
;
schemaName
schemaName
...
...
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/Keyword.g4
浏览文件 @
67829ee4
...
@@ -463,22 +463,10 @@ CALL
...
@@ -463,22 +463,10 @@ CALL
: C A L L
: C A L L
;
;
INSTANCE
: I N S T A N C E
;
PRESERVE
PRESERVE
: P R E S E R V E
: P R E S E R V E
;
;
DO
: D O
;
DEFINER
: D E F I N E R
;
CURRENT_USER
CURRENT_USER
: C U R R E N T UL_ U S E R
: C U R R E N T UL_ U S E R
;
;
...
@@ -495,3 +483,7 @@ CASCADED
...
@@ -495,3 +483,7 @@ CASCADED
LOCAL
LOCAL
: L O C A L
: L O C A L
;
;
NAME
: N A M E
;
sharding-core/sharding-core-parse/sharding-core-parse-postgresql/src/main/antlr4/imports/postgresql/PostgreSQLKeyword.g4
浏览文件 @
67829ee4
...
@@ -474,3 +474,11 @@ GROUPS
...
@@ -474,3 +474,11 @@ GROUPS
RECURSIVE
RECURSIVE
: R E C U R S I V E
: R E C U R S I V E
;
;
DO
: D O
;
INSTANCE
: I N S T A N C E
;
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/BaseRule.g4
浏览文件 @
67829ee4
...
@@ -94,7 +94,8 @@ unreservedWord_
...
@@ -94,7 +94,8 @@ unreservedWord_
| MASTER | DATA | SOURCE | FILE | FORMAT | LIBRARY | FULLTEXT | MASK | UNMASK
| MASTER | DATA | SOURCE | FILE | FORMAT | LIBRARY | FULLTEXT | MASK | UNMASK
| MESSAGE | TYPE | REMOTE | BINDING | ROUTE | SECURITY | POLICY | AGGREGATE | QUEUE
| MESSAGE | TYPE | REMOTE | BINDING | ROUTE | SECURITY | POLICY | AGGREGATE | QUEUE
| RULE | SYNONYM | COLLECTION | SCRIPT | KILL | BACKUP | LOG | SHOWPLAN
| RULE | SYNONYM | COLLECTION | SCRIPT | KILL | BACKUP | LOG | SHOWPLAN
| SUBSCRIBE | QUERY | NOTIFICATIONS | CHECKPOINT | SEQUENCE | INSTANCE | DO | DEFINER | LOCAL | CASCADED
| SUBSCRIBE | QUERY | NOTIFICATIONS | CHECKPOINT | SEQUENCE | INSTANCE | LOCAL | CASCADED
| NAME
;
;
schemaName
schemaName
...
...
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/Keyword.g4
浏览文件 @
67829ee4
...
@@ -463,22 +463,10 @@ CALL
...
@@ -463,22 +463,10 @@ CALL
: C A L L
: C A L L
;
;
INSTANCE
: I N S T A N C E
;
PRESERVE
PRESERVE
: P R E S E R V E
: P R E S E R V E
;
;
DO
: D O
;
DEFINER
: D E F I N E R
;
CURRENT_USER
CURRENT_USER
: C U R R E N T UL_ U S E R
: C U R R E N T UL_ U S E R
;
;
...
@@ -495,3 +483,7 @@ CASCADED
...
@@ -495,3 +483,7 @@ CASCADED
LOCAL
LOCAL
: L O C A L
: L O C A L
;
;
NAME
: N A M E
;
sharding-core/sharding-core-parse/sharding-core-parse-sqlserver/src/main/antlr4/imports/sqlserver/SQLServerKeyword.g4
浏览文件 @
67829ee4
...
@@ -846,3 +846,7 @@ DROP_EXISTING
...
@@ -846,3 +846,7 @@ DROP_EXISTING
ROW_NUMBER
ROW_NUMBER
: R O W UL_ N U M B E R
: R O W UL_ N U M B E R
;
;
INSTANCE
: I N S T A N C E
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录