Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿拉亮
soar
提交
d3471788
S
soar
项目概览
阿拉亮
/
soar
与 Fork 源项目一致
Fork自
Xiaomi / soar
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
soar
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d3471788
编写于
12月 27, 2018
作者:
martianzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
daily update pingcap/parser
support FULLTEXT INDEX syntax
上级
864305d5
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1916 addition
and
1778 deletion
+1916
-1778
vendor/github.com/pingcap/parser/ast/ddl.go
vendor/github.com/pingcap/parser/ast/ddl.go
+66
-2
vendor/github.com/pingcap/parser/ast/dml.go
vendor/github.com/pingcap/parser/ast/dml.go
+32
-4
vendor/github.com/pingcap/parser/ast/expressions.go
vendor/github.com/pingcap/parser/ast/expressions.go
+51
-5
vendor/github.com/pingcap/parser/parser.go
vendor/github.com/pingcap/parser/parser.go
+1730
-1730
vendor/github.com/pingcap/parser/parser.y
vendor/github.com/pingcap/parser/parser.y
+1
-1
vendor/vendor.json
vendor/vendor.json
+36
-36
未找到文件。
vendor/github.com/pingcap/parser/ast/ddl.go
浏览文件 @
d3471788
...
...
@@ -473,7 +473,58 @@ type Constraint struct {
// Restore implements Node interface.
func
(
n
*
Constraint
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
switch
n
.
Tp
{
case
ConstraintNoConstraint
:
return
nil
case
ConstraintPrimaryKey
:
ctx
.
WriteKeyWord
(
"PRIMARY KEY"
)
case
ConstraintKey
:
ctx
.
WriteKeyWord
(
"KEY"
)
case
ConstraintIndex
:
ctx
.
WriteKeyWord
(
"INDEX"
)
case
ConstraintUniq
:
ctx
.
WriteKeyWord
(
"UNIQUE"
)
case
ConstraintUniqKey
:
ctx
.
WriteKeyWord
(
"UNIQUE KEY"
)
case
ConstraintUniqIndex
:
ctx
.
WriteKeyWord
(
"UNIQUE INDEX"
)
case
ConstraintForeignKey
:
ctx
.
WriteKeyWord
(
"FOREIGN KEY"
)
case
ConstraintFulltext
:
ctx
.
WriteKeyWord
(
"FULLTEXT"
)
}
if
n
.
Name
!=
""
{
ctx
.
WritePlain
(
" "
)
ctx
.
WriteName
(
n
.
Name
)
}
ctx
.
WritePlain
(
"("
)
for
i
,
keys
:=
range
n
.
Keys
{
if
i
>
0
{
ctx
.
WritePlain
(
", "
)
}
if
err
:=
keys
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while splicing Constraint Keys: [%v]"
,
i
)
}
}
ctx
.
WritePlain
(
")"
)
if
n
.
Refer
!=
nil
{
ctx
.
WritePlain
(
" "
)
if
err
:=
n
.
Refer
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing Constraint Refer"
)
}
}
if
n
.
Option
!=
nil
{
ctx
.
WritePlain
(
" "
)
if
err
:=
n
.
Option
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing Constraint Option"
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -955,7 +1006,20 @@ type ColumnPosition struct {
// Restore implements Node interface.
func
(
n
*
ColumnPosition
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
switch
n
.
Tp
{
case
ColumnPositionNone
:
// do nothing
case
ColumnPositionFirst
:
ctx
.
WriteKeyWord
(
"FIRST"
)
case
ColumnPositionAfter
:
ctx
.
WriteKeyWord
(
"AFTER "
)
if
err
:=
n
.
RelativeColumn
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore ColumnPosition.RelativeColumn"
)
}
default
:
return
errors
.
Errorf
(
"invalid ColumnPositionType: %d"
,
n
.
Tp
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
vendor/github.com/pingcap/parser/ast/dml.go
浏览文件 @
d3471788
...
...
@@ -579,7 +579,13 @@ type ByItem struct {
// Restore implements Node interface.
func
(
n
*
ByItem
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
err
:=
n
.
Expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore ByItem.Expr"
)
}
if
n
.
Desc
{
ctx
.
WriteKeyWord
(
" DESC"
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -605,7 +611,16 @@ type GroupByClause struct {
// Restore implements Node interface.
func
(
n
*
GroupByClause
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"GROUP BY "
)
for
i
,
v
:=
range
n
.
Items
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
v
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while restore GroupByClause.Items[%d]"
,
i
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -633,7 +648,11 @@ type HavingClause struct {
// Restore implements Node interface.
func
(
n
*
HavingClause
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"HAVING "
)
if
err
:=
n
.
Expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore HavingClause.Expr"
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -660,7 +679,16 @@ type OrderByClause struct {
// Restore implements Node interface.
func
(
n
*
OrderByClause
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"ORDER BY "
)
for
i
,
item
:=
range
n
.
Items
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
item
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while restore OrderByClause.Items[%d]"
,
i
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
vendor/github.com/pingcap/parser/ast/expressions.go
浏览文件 @
d3471788
...
...
@@ -606,7 +606,30 @@ type PatternInExpr struct {
// Restore implements Node interface.
func
(
n
*
PatternInExpr
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
err
:=
n
.
Expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore PatternInExpr.Expr"
)
}
if
n
.
Not
{
ctx
.
WriteKeyWord
(
" NOT IN "
)
}
else
{
ctx
.
WriteKeyWord
(
" IN "
)
}
ctx
.
WritePlain
(
"("
)
for
i
,
expr
:=
range
n
.
List
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while restore PatternInExpr.List[%d]"
,
i
)
}
}
if
n
.
Sel
!=
nil
{
if
err
:=
n
.
Sel
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore PatternInExpr.Sel"
)
}
}
ctx
.
WritePlain
(
")"
)
return
nil
}
// Format the ExprNode into a Writer.
...
...
@@ -618,10 +641,10 @@ func (n *PatternInExpr) Format(w io.Writer) {
fmt
.
Fprint
(
w
,
" IN ("
)
}
for
i
,
expr
:=
range
n
.
List
{
expr
.
Format
(
w
)
if
i
!=
len
(
n
.
List
)
-
1
{
if
i
!=
0
{
fmt
.
Fprint
(
w
,
","
)
}
expr
.
Format
(
w
)
}
fmt
.
Fprint
(
w
,
")"
)
}
...
...
@@ -898,7 +921,8 @@ type PositionExpr struct {
// Restore implements Node interface.
func
(
n
*
PositionExpr
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WritePlainf
(
"%d"
,
n
.
N
)
return
nil
}
// Format the ExprNode into a Writer.
...
...
@@ -1134,7 +1158,29 @@ type VariableExpr struct {
// Restore implements Node interface.
func
(
n
*
VariableExpr
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
IsSystem
{
ctx
.
WritePlain
(
"@@"
)
if
n
.
ExplicitScope
{
if
n
.
IsGlobal
{
ctx
.
WriteKeyWord
(
"GLOBAL"
)
}
else
{
ctx
.
WriteKeyWord
(
"SESSION"
)
}
ctx
.
WritePlain
(
"."
)
}
}
else
{
ctx
.
WritePlain
(
"@"
)
}
ctx
.
WriteName
(
n
.
Name
)
if
n
.
Value
!=
nil
{
ctx
.
WritePlain
(
":="
)
if
err
:=
n
.
Value
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore VariableExpr.Value"
)
}
}
return
nil
}
// Format the ExprNode into a Writer.
...
...
vendor/github.com/pingcap/parser/parser.go
浏览文件 @
d3471788
此差异已折叠。
点击以展开。
vendor/github.com/pingcap/parser/parser.y
浏览文件 @
d3471788
...
...
@@ -1600,7 +1600,7 @@ ConstraintElem:
}
$$
=
c
}
|
"FULLTEXT"
KeyOrIndex
IndexName
'('
IndexColNameList
')'
IndexOptionList
|
"FULLTEXT"
KeyOrIndex
Opt
IndexName
'('
IndexColNameList
')'
IndexOptionList
{
c
:=
&
ast
.
Constraint
{
Tp
:
ast
.
ConstraintFulltext
,
...
...
vendor/vendor.json
浏览文件 @
d3471788
...
...
@@ -111,106 +111,106 @@
"revisionTime"
:
"2018-10-24T15:10:47Z"
},
{
"checksumSHA1"
:
"
FxmJCOCuTOYTN1ISPbT/W6Lrj+Y
="
,
"checksumSHA1"
:
"
KLFQyY05NrGhQCM+Lthp/X9/YcE
="
,
"path"
:
"github.com/pingcap/parser"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"
oXrBRlcgn7WLUQaAHjjygoP4bv4
="
,
"checksumSHA1"
:
"
s7vZWQ/fyhgaPag6j8hQnZ3t3SY
="
,
"path"
:
"github.com/pingcap/parser/ast"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"skWGV4FNvD3vr+5olepaPPnylUw="
,
"path"
:
"github.com/pingcap/parser/auth"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"t4UHo966WzU9Z0IJkyGHRp0loOk="
,
"path"
:
"github.com/pingcap/parser/charset"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"SInoXbsRe0tnBwmatmtZYfSFbdk="
,
"path"
:
"github.com/pingcap/parser/format"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"WZYTGDMnc1UfTdjdZoBbISsnpRY="
,
"path"
:
"github.com/pingcap/parser/model"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"QBa9yiMDQNl2cLLwqlRoNTpCPNg="
,
"path"
:
"github.com/pingcap/parser/mysql"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"mxpiJJ3b08I0o0Sd2rJLYMwz7uw="
,
"path"
:
"github.com/pingcap/parser/opcode"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"XvnUllvwMYd6HrMvMiKnn4cGN2M="
,
"path"
:
"github.com/pingcap/parser/terror"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"YoDiJ3sniNqxkP5X/BDkx6efteA="
,
"path"
:
"github.com/pingcap/parser/types"
,
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
"revision"
:
"
60752e9154861ea1890cff3cdf84e75e67b02281
"
,
"revisionTime"
:
"2018-12-2
6T14:52:28
Z"
},
{
"checksumSHA1"
:
"Uv9aqrZqzNFUgUferYPfNGUxOmM="
,
"path"
:
"github.com/pingcap/tidb/sessionctx/stmtctx"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"kXyszfR2fQ6bHvuCCFlHRkt1mF0="
,
"path"
:
"github.com/pingcap/tidb/types"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"DWVD7+ygtT66IQ+cqXmMJ5OVqUk="
,
"path"
:
"github.com/pingcap/tidb/types/json"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"6vi/eCZXqNTa5eAUpxDZet4LPlY="
,
"path"
:
"github.com/pingcap/tidb/types/parser_driver"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"SS7twHZofFKr8w/pwIKmkp3u5qU="
,
"path"
:
"github.com/pingcap/tidb/util/execdetails"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"nUC7zVoAMNR2a+z2iGqHoN2AkFE="
,
"path"
:
"github.com/pingcap/tidb/util/hack"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"xSyepiuqsoaaeDch7cXeumvVHKM="
,
"path"
:
"github.com/pingcap/tidb/util/memory"
,
"revision"
:
"
b74d0283a2a6f780b75c7192e760b41a03e8088
4"
,
"revisionTime"
:
"2018-12-2
5T14:40:38
Z"
"revision"
:
"
e45e6999cbd29fbd14cf8c93669b2e45907b415
4"
,
"revisionTime"
:
"2018-12-2
7T06:12:19
Z"
},
{
"checksumSHA1"
:
"SmYeIK/fIYXNu8IKxD6HOVQVTuU="
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录