Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿拉亮
soar
提交
1457abf1
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,发现更多精彩内容 >>
提交
1457abf1
编写于
12月 25, 2018
作者:
martianzhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pingcap/parser daily update
上级
5619dd32
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
393 addition
and
115 deletion
+393
-115
vendor/github.com/pingcap/parser/Makefile
vendor/github.com/pingcap/parser/Makefile
+6
-2
vendor/github.com/pingcap/parser/ast/ddl.go
vendor/github.com/pingcap/parser/ast/ddl.go
+88
-8
vendor/github.com/pingcap/parser/ast/dml.go
vendor/github.com/pingcap/parser/ast/dml.go
+116
-6
vendor/github.com/pingcap/parser/ast/expressions.go
vendor/github.com/pingcap/parser/ast/expressions.go
+14
-2
vendor/github.com/pingcap/parser/ast/util.go
vendor/github.com/pingcap/parser/ast/util.go
+4
-3
vendor/github.com/pingcap/parser/circle.yml
vendor/github.com/pingcap/parser/circle.yml
+3
-0
vendor/github.com/pingcap/parser/lexer.go
vendor/github.com/pingcap/parser/lexer.go
+37
-27
vendor/github.com/pingcap/parser/opcode/opcode.go
vendor/github.com/pingcap/parser/opcode/opcode.go
+1
-1
vendor/github.com/pingcap/parser/parser.go
vendor/github.com/pingcap/parser/parser.go
+1
-0
vendor/github.com/pingcap/parser/parser.y
vendor/github.com/pingcap/parser/parser.y
+1
-0
vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go
vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go
+10
-7
vendor/github.com/pingcap/tidb/util/execdetails/execdetails.go
...r/github.com/pingcap/tidb/util/execdetails/execdetails.go
+53
-0
vendor/vendor.json
vendor/vendor.json
+59
-59
未找到文件。
vendor/github.com/pingcap/parser/Makefile
浏览文件 @
1457abf1
...
...
@@ -4,9 +4,9 @@ ARCH:="`uname -s`"
MAC
:=
"Darwin"
LINUX
:=
"Linux"
all
:
parser.go
all
:
parser.go
fmt
test
:
parser.go
test
:
parser.go
fmt
sh test.sh
parser.go
:
parser.y
...
...
@@ -31,6 +31,10 @@ parser: bin/goyacc
bin/goyacc
:
goyacc/main.go
GO111MODULE
=
on go build
-o
bin/goyacc goyacc/main.go
fmt
:
@
echo
"gofmt (simplify)"
@
gofmt
-s
-l
-w
.
2>&1 |
awk
'{print} END{if(NR>0) {exit 1}}'
clean
:
go clean
-i
./...
rm
-rf
*
.out
...
...
vendor/github.com/pingcap/parser/ast/ddl.go
浏览文件 @
1457abf1
...
...
@@ -156,7 +156,13 @@ type IndexColName struct {
// Restore implements Node interface.
func
(
n
*
IndexColName
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
err
:=
n
.
Column
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing IndexColName"
)
}
if
n
.
Length
>
0
{
ctx
.
WritePlainf
(
"(%d)"
,
n
.
Length
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -187,7 +193,35 @@ type ReferenceDef struct {
// Restore implements Node interface.
func
(
n
*
ReferenceDef
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
Table
!=
nil
{
ctx
.
WriteKeyWord
(
"REFERENCES "
)
if
err
:=
n
.
Table
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing ReferenceDef"
)
}
}
ctx
.
WritePlain
(
"("
)
for
i
,
indexColNames
:=
range
n
.
IndexColNames
{
if
i
>
0
{
ctx
.
WritePlain
(
", "
)
}
if
err
:=
indexColNames
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while splicing IndexColNames: [%v]"
,
i
)
}
}
ctx
.
WritePlain
(
")"
)
if
n
.
OnDelete
.
ReferOpt
!=
ReferOptionNoOption
{
ctx
.
WritePlain
(
" "
)
if
err
:=
n
.
OnDelete
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing OnDelete"
)
}
}
if
n
.
OnUpdate
.
ReferOpt
!=
ReferOptionNoOption
{
ctx
.
WritePlain
(
" "
)
if
err
:=
n
.
OnUpdate
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while splicing OnUpdate"
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -257,7 +291,11 @@ type OnDeleteOpt struct {
// Restore implements Node interface.
func
(
n
*
OnDeleteOpt
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
ReferOpt
!=
ReferOptionNoOption
{
ctx
.
WriteKeyWord
(
"ON DELETE "
)
ctx
.
WriteKeyWord
(
n
.
ReferOpt
.
String
())
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -278,7 +316,11 @@ type OnUpdateOpt struct {
// Restore implements Node interface.
func
(
n
*
OnUpdateOpt
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
ReferOpt
!=
ReferOptionNoOption
{
ctx
.
WriteKeyWord
(
"ON UPDATE "
)
ctx
.
WriteKeyWord
(
n
.
ReferOpt
.
String
())
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -578,7 +620,25 @@ type DropTableStmt struct {
// Restore implements Node interface.
func
(
n
*
DropTableStmt
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
IsView
{
ctx
.
WriteKeyWord
(
"DROP VIEW "
)
}
else
{
ctx
.
WriteKeyWord
(
"DROP TABLE "
)
}
if
n
.
IfExists
{
ctx
.
WriteKeyWord
(
"IF EXISTS "
)
}
for
index
,
table
:=
range
n
.
Tables
{
if
index
!=
0
{
ctx
.
WritePlain
(
", "
)
}
if
err
:=
table
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore DropTableStmt.Tables "
+
string
(
index
))
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -613,7 +673,16 @@ type RenameTableStmt struct {
// Restore implements Node interface.
func
(
n
*
RenameTableStmt
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"RENAME TABLE "
)
for
index
,
table2table
:=
range
n
.
TableToTables
{
if
index
!=
0
{
ctx
.
WritePlain
(
", "
)
}
if
err
:=
table2table
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore RenameTableStmt.TableToTables"
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -654,7 +723,14 @@ type TableToTable struct {
// Restore implements Node interface.
func
(
n
*
TableToTable
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
err
:=
n
.
OldTable
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore TableToTable.OldTable"
)
}
ctx
.
WriteKeyWord
(
" TO "
)
if
err
:=
n
.
NewTable
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore TableToTable.NewTable"
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -1055,7 +1131,11 @@ type TruncateTableStmt struct {
// Restore implements Node interface.
func
(
n
*
TruncateTableStmt
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"TRUNCATE TABLE "
)
if
err
:=
n
.
Table
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore TruncateTableStmt.Table"
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
vendor/github.com/pingcap/parser/ast/dml.go
浏览文件 @
1457abf1
...
...
@@ -85,7 +85,59 @@ type Join struct {
// Restore implements Node interface.
func
(
n
*
Join
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
ctx
.
JoinLevel
!=
0
{
ctx
.
WritePlain
(
"("
)
defer
ctx
.
WritePlain
(
")"
)
}
ctx
.
JoinLevel
++
if
err
:=
n
.
Left
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore Join.Left"
)
}
ctx
.
JoinLevel
--
if
n
.
Right
==
nil
{
return
nil
}
if
n
.
NaturalJoin
{
ctx
.
WriteKeyWord
(
" NATURAL"
)
}
switch
n
.
Tp
{
case
LeftJoin
:
ctx
.
WriteKeyWord
(
" LEFT"
)
case
RightJoin
:
ctx
.
WriteKeyWord
(
" RIGHT"
)
}
if
n
.
StraightJoin
{
ctx
.
WriteKeyWord
(
" STRAIGHT_JOIN "
)
}
else
{
ctx
.
WriteKeyWord
(
" JOIN "
)
}
ctx
.
JoinLevel
++
if
err
:=
n
.
Right
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore Join.Right"
)
}
ctx
.
JoinLevel
--
if
n
.
On
!=
nil
{
ctx
.
WriteKeyWord
(
" ON "
)
if
err
:=
n
.
On
.
Expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore Join.On"
)
}
}
if
len
(
n
.
Using
)
!=
0
{
ctx
.
WriteKeyWord
(
" USING "
)
ctx
.
WritePlain
(
"("
)
for
i
,
v
:=
range
n
.
Using
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
v
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore Join.Using"
)
}
}
ctx
.
WritePlain
(
")"
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -234,7 +286,15 @@ type DeleteTableList struct {
// Restore implements Node interface.
func
(
n
*
DeleteTableList
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
for
i
,
t
:=
range
n
.
Tables
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
t
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while restore DeleteTableList.Tables[%v]"
,
i
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -297,7 +357,26 @@ type TableSource struct {
// Restore implements Node interface.
func
(
n
*
TableSource
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
needParen
:=
false
switch
n
.
Source
.
(
type
)
{
case
*
SelectStmt
,
*
UnionStmt
:
needParen
=
true
}
if
needParen
{
ctx
.
WritePlain
(
"("
)
}
if
err
:=
n
.
Source
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore TableSource.Source"
)
}
if
needParen
{
ctx
.
WritePlain
(
")"
)
}
if
asName
:=
n
.
AsName
.
String
();
asName
!=
""
{
ctx
.
WriteKeyWord
(
" AS "
)
ctx
.
WriteName
(
asName
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -348,7 +427,16 @@ type WildCardField struct {
// Restore implements Node interface.
func
(
n
*
WildCardField
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
schema
:=
n
.
Schema
.
String
();
schema
!=
""
{
ctx
.
WriteName
(
schema
)
ctx
.
WritePlain
(
"."
)
}
if
table
:=
n
.
Table
.
String
();
table
!=
""
{
ctx
.
WriteName
(
table
)
ctx
.
WritePlain
(
"."
)
}
ctx
.
WritePlain
(
"*"
)
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -383,7 +471,21 @@ type SelectField struct {
// Restore implements Node interface.
func
(
n
*
SelectField
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
if
n
.
WildCard
!=
nil
{
if
err
:=
n
.
WildCard
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore SelectField.WildCard"
)
}
}
if
n
.
Expr
!=
nil
{
if
err
:=
n
.
Expr
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotate
(
err
,
"An error occurred while restore SelectField.Expr"
)
}
}
if
asName
:=
n
.
AsName
.
String
();
asName
!=
""
{
ctx
.
WriteKeyWord
(
" AS "
)
ctx
.
WriteName
(
asName
)
}
return
nil
}
// Accept implements Node Accept interface.
...
...
@@ -412,7 +514,15 @@ type FieldList struct {
// Restore implements Node interface.
func
(
n
*
FieldList
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
for
i
,
v
:=
range
n
.
Fields
{
if
i
!=
0
{
ctx
.
WritePlain
(
", "
)
}
if
err
:=
v
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred while restore FieldList.Fields[%d]"
,
i
)
}
}
return
nil
}
// Accept implements Node Accept interface.
...
...
vendor/github.com/pingcap/parser/ast/expressions.go
浏览文件 @
1457abf1
...
...
@@ -999,7 +999,18 @@ type RowExpr struct {
// Restore implements Node interface.
func
(
n
*
RowExpr
)
Restore
(
ctx
*
RestoreCtx
)
error
{
return
errors
.
New
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"ROW"
)
ctx
.
WritePlain
(
"("
)
for
i
,
v
:=
range
n
.
Values
{
if
i
!=
0
{
ctx
.
WritePlain
(
","
)
}
if
err
:=
v
.
Restore
(
ctx
);
err
!=
nil
{
return
errors
.
Annotatef
(
err
,
"An error occurred when restore RowExpr.Values[%v]"
,
i
)
}
}
ctx
.
WritePlain
(
")"
)
return
nil
}
// Format the ExprNode into a Writer.
...
...
@@ -1157,7 +1168,8 @@ type MaxValueExpr struct {
// Restore implements Node interface.
func
(
n
*
MaxValueExpr
)
Restore
(
ctx
*
RestoreCtx
)
error
{
panic
(
"Not implemented"
)
ctx
.
WriteKeyWord
(
"MAXVALUE"
)
return
nil
}
// Format the ExprNode into a Writer.
...
...
vendor/github.com/pingcap/parser/ast/util.go
浏览文件 @
1457abf1
...
...
@@ -144,13 +144,14 @@ func (rf RestoreFlags) HasNameBackQuotesFlag() bool {
// RestoreCtx is `Restore` context to hold flags and writer.
type
RestoreCtx
struct
{
Flags
RestoreFlags
In
io
.
Writer
Flags
RestoreFlags
In
io
.
Writer
JoinLevel
int
}
// NewRestoreCtx returns a new `RestoreCtx`.
func
NewRestoreCtx
(
flags
RestoreFlags
,
in
io
.
Writer
)
*
RestoreCtx
{
return
&
RestoreCtx
{
flags
,
in
}
return
&
RestoreCtx
{
flags
,
in
,
0
}
}
// WriteKeyWord writes the `keyWord` into writer.
...
...
vendor/github.com/pingcap/parser/circle.yml
浏览文件 @
1457abf1
...
...
@@ -13,6 +13,9 @@ jobs:
mv parser.go parser.go.committed
make parser
diff -u parser.go.committed parser.go
-
run
:
name
:
"
Check
code
format"
command
:
make fmt
-
run
:
name
:
"
Build
&
Test"
command
:
make test
vendor/github.com/pingcap/parser/lexer.go
浏览文件 @
1457abf1
...
...
@@ -430,45 +430,36 @@ func sqlOffsetInComment(comment string) int {
func
startWithAt
(
s
*
Scanner
)
(
tok
int
,
pos
Pos
,
lit
string
)
{
pos
=
s
.
r
.
pos
()
s
.
r
.
inc
()
ch1
:=
s
.
r
.
peek
()
if
ch1
==
'\'
'
||
ch1
==
'"'
{
nTok
,
nPos
,
nLit
:=
startString
(
s
)
if
nTok
==
stringLit
{
tok
=
singleAtIdentifier
pos
=
nPos
lit
=
nLit
}
else
{
tok
=
int
(
'@'
)
}
}
else
if
ch1
==
'`'
{
nTok
,
nPos
,
nLit
:=
scanQuotedIdent
(
s
)
if
nTok
==
quotedIdentifier
{
tok
=
singleAtIdentifier
pos
=
nPos
lit
=
nLit
}
else
{
tok
=
int
(
'@'
)
}
}
else
if
isUserVarChar
(
ch1
)
{
s
.
r
.
incAsLongAs
(
isUserVarChar
)
tok
,
lit
=
singleAtIdentifier
,
s
.
r
.
data
(
&
pos
)
}
else
if
ch1
==
'@'
{
tok
,
lit
=
scanIdentifierOrString
(
s
)
switch
tok
{
case
'@'
:
s
.
r
.
inc
()
stream
:=
s
.
r
.
s
[
pos
.
Offset
+
2
:
]
var
prefix
string
for
_
,
v
:=
range
[]
string
{
"global."
,
"session."
,
"local."
}
{
if
len
(
v
)
>
len
(
stream
)
{
continue
}
if
strings
.
EqualFold
(
stream
[
:
len
(
v
)],
v
)
{
prefix
=
v
s
.
r
.
incN
(
len
(
v
))
break
}
}
s
.
r
.
incAsLongAs
(
isIdentChar
)
tok
,
lit
=
doubleAtIdentifier
,
s
.
r
.
data
(
&
pos
)
}
else
{
tok
,
lit
=
singleAtIdentifier
,
s
.
r
.
data
(
&
pos
)
tok
,
lit
=
scanIdentifierOrString
(
s
)
switch
tok
{
case
stringLit
,
quotedIdentifier
:
tok
,
lit
=
doubleAtIdentifier
,
"@@"
+
prefix
+
lit
case
identifier
:
tok
,
lit
=
doubleAtIdentifier
,
s
.
r
.
data
(
&
pos
)
}
case
unicode
.
ReplacementChar
:
break
default
:
tok
=
singleAtIdentifier
}
return
}
...
...
@@ -479,6 +470,25 @@ func scanIdentifier(s *Scanner) (int, Pos, string) {
return
identifier
,
pos
,
s
.
r
.
data
(
&
pos
)
}
func
scanIdentifierOrString
(
s
*
Scanner
)
(
tok
int
,
lit
string
)
{
ch1
:=
s
.
r
.
peek
()
switch
ch1
{
case
'\'
'
,
'"'
:
tok
,
_
,
lit
=
startString
(
s
)
case
'`'
:
tok
,
_
,
lit
=
scanQuotedIdent
(
s
)
default
:
if
isUserVarChar
(
ch1
)
{
pos
:=
s
.
r
.
pos
()
s
.
r
.
incAsLongAs
(
isUserVarChar
)
tok
,
lit
=
identifier
,
s
.
r
.
data
(
&
pos
)
}
else
{
tok
=
int
(
ch1
)
}
}
return
}
var
(
quotedIdentifier
=
-
identifier
)
...
...
vendor/github.com/pingcap/parser/opcode/opcode.go
浏览文件 @
1457abf1
...
...
@@ -109,7 +109,7 @@ var opsLiteral = map[Op]string{
RightShift
:
">>"
,
GE
:
">="
,
LE
:
"<="
,
EQ
:
"=
=
"
,
EQ
:
"="
,
NE
:
"!="
,
LT
:
"<"
,
GT
:
">"
,
...
...
vendor/github.com/pingcap/parser/parser.go
浏览文件 @
1457abf1
...
...
@@ -10480,6 +10480,7 @@ yynewstate:
{
yyerrok()
parser.lastErrorAsWarn()
parser.yyVAL.item = nil
}
case 979:
{
vendor/github.com/pingcap/parser/parser.y
浏览文件 @
1457abf1
...
...
@@ -5195,6 +5195,7 @@ TableOptimizerHints:
{
yyerrok
()
parser
.
lastErrorAsWarn
()
$$
=
nil
}
HintTableList
:
...
...
vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go
浏览文件 @
1457abf1
...
...
@@ -356,14 +356,17 @@ func (sc *StatementContext) ResetForRetry() {
// MergeExecDetails merges a single region execution details into self, used to print
// the information in slow query log.
func
(
sc
*
StatementContext
)
MergeExecDetails
(
details
*
execdetails
.
ExecDetails
)
{
func
(
sc
*
StatementContext
)
MergeExecDetails
(
details
*
execdetails
.
ExecDetails
,
commitDetails
*
execdetails
.
CommitDetails
)
{
sc
.
mu
.
Lock
()
sc
.
mu
.
execDetails
.
ProcessTime
+=
details
.
ProcessTime
sc
.
mu
.
execDetails
.
WaitTime
+=
details
.
WaitTime
sc
.
mu
.
execDetails
.
BackoffTime
+=
details
.
BackoffTime
sc
.
mu
.
execDetails
.
RequestCount
++
sc
.
mu
.
execDetails
.
TotalKeys
+=
details
.
TotalKeys
sc
.
mu
.
execDetails
.
ProcessedKeys
+=
details
.
ProcessedKeys
if
details
!=
nil
{
sc
.
mu
.
execDetails
.
ProcessTime
+=
details
.
ProcessTime
sc
.
mu
.
execDetails
.
WaitTime
+=
details
.
WaitTime
sc
.
mu
.
execDetails
.
BackoffTime
+=
details
.
BackoffTime
sc
.
mu
.
execDetails
.
RequestCount
++
sc
.
mu
.
execDetails
.
TotalKeys
+=
details
.
TotalKeys
sc
.
mu
.
execDetails
.
ProcessedKeys
+=
details
.
ProcessedKeys
}
sc
.
mu
.
execDetails
.
CommitDetail
=
commitDetails
sc
.
mu
.
Unlock
()
}
...
...
vendor/github.com/pingcap/tidb/util/execdetails/execdetails.go
浏览文件 @
1457abf1
...
...
@@ -21,6 +21,9 @@ import (
"time"
)
// CommitDetailCtxKey presents CommitDetail info key in context.
const
CommitDetailCtxKey
=
"commitDetail"
// ExecDetails contains execution detail information.
type
ExecDetails
struct
{
ProcessTime
time
.
Duration
...
...
@@ -29,6 +32,21 @@ type ExecDetails struct {
RequestCount
int
TotalKeys
int64
ProcessedKeys
int64
CommitDetail
*
CommitDetails
}
// CommitDetails contains commit detail information.
type
CommitDetails
struct
{
GetCommitTsTime
time
.
Duration
PrewriteTime
time
.
Duration
CommitTime
time
.
Duration
LocalLatchTime
time
.
Duration
TotalBackoffTime
time
.
Duration
ResolveLockTime
int64
WriteKeys
int
WriteSize
int
PrewriteRegionNum
int32
TxnRetry
int
}
// String implements the fmt.Stringer interface.
...
...
@@ -52,6 +70,41 @@ func (d ExecDetails) String() string {
if
d
.
ProcessedKeys
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"processed_keys:%d"
,
d
.
ProcessedKeys
))
}
commitDetails
:=
d
.
CommitDetail
if
commitDetails
!=
nil
{
if
commitDetails
.
PrewriteTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"prewrite_time:%v"
,
commitDetails
.
PrewriteTime
))
}
if
commitDetails
.
CommitTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"commit_time:%v"
,
commitDetails
.
CommitTime
))
}
if
commitDetails
.
GetCommitTsTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"get_commit_ts_time:%v"
,
commitDetails
.
GetCommitTsTime
))
}
if
commitDetails
.
TotalBackoffTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"total_backoff_time:%v"
,
commitDetails
.
TotalBackoffTime
))
}
resolveLockTime
:=
atomic
.
LoadInt64
(
&
commitDetails
.
ResolveLockTime
)
if
resolveLockTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"resolve_lock_time:%d"
,
time
.
Duration
(
resolveLockTime
)))
}
if
commitDetails
.
LocalLatchTime
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"local_latch_wait_time:%v"
,
commitDetails
.
LocalLatchTime
))
}
if
commitDetails
.
WriteKeys
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"write_keys:%d"
,
commitDetails
.
WriteKeys
))
}
if
commitDetails
.
WriteSize
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"write_size:%d"
,
commitDetails
.
WriteSize
))
}
prewriteRegionNum
:=
atomic
.
LoadInt32
(
&
commitDetails
.
PrewriteRegionNum
)
if
prewriteRegionNum
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"prewrite_region:%d"
,
prewriteRegionNum
))
}
if
commitDetails
.
TxnRetry
>
0
{
parts
=
append
(
parts
,
fmt
.
Sprintf
(
"txn_retry:%d"
,
commitDetails
.
TxnRetry
))
}
}
return
strings
.
Join
(
parts
,
" "
)
}
...
...
vendor/vendor.json
浏览文件 @
1457abf1
...
...
@@ -111,106 +111,106 @@
"revisionTime"
:
"2018-10-24T15:10:47Z"
},
{
"checksumSHA1"
:
"
cbEXJvrHC69taa1/5o/VlbkZy/g
="
,
"checksumSHA1"
:
"
FxmJCOCuTOYTN1ISPbT/W6Lrj+Y
="
,
"path"
:
"github.com/pingcap/parser"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"
9pUt2OvfLX8RpWG8gq4efJ33eQw
="
,
"checksumSHA1"
:
"
oXrBRlcgn7WLUQaAHjjygoP4bv4
="
,
"path"
:
"github.com/pingcap/parser/ast"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"skWGV4FNvD3vr+5olepaPPnylUw="
,
"path"
:
"github.com/pingcap/parser/auth"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"t4UHo966WzU9Z0IJkyGHRp0loOk="
,
"path"
:
"github.com/pingcap/parser/charset"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"SInoXbsRe0tnBwmatmtZYfSFbdk="
,
"path"
:
"github.com/pingcap/parser/format"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"WZYTGDMnc1UfTdjdZoBbISsnpRY="
,
"path"
:
"github.com/pingcap/parser/model"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"QBa9yiMDQNl2cLLwqlRoNTpCPNg="
,
"path"
:
"github.com/pingcap/parser/mysql"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"
+O6CYIE0jT8pIDxWRP9FtKwFZjI
="
,
"checksumSHA1"
:
"
mxpiJJ3b08I0o0Sd2rJLYMwz7uw
="
,
"path"
:
"github.com/pingcap/parser/opcode"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"XvnUllvwMYd6HrMvMiKnn4cGN2M="
,
"path"
:
"github.com/pingcap/parser/terror"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"YoDiJ3sniNqxkP5X/BDkx6efteA="
,
"path"
:
"github.com/pingcap/parser/types"
,
"revision"
:
"
651ad7108326d8bc3991288d749bb6c778135216
"
,
"revisionTime"
:
"2018-12-2
1T12:21:43
Z"
"revision"
:
"
fdccc3290b115557ceee44e21578b58005666fbf
"
,
"revisionTime"
:
"2018-12-2
5T12:12:10
Z"
},
{
"checksumSHA1"
:
"
+0bf1l46m6GG7JtACNufnZG0OUw
="
,
"checksumSHA1"
:
"
Uv9aqrZqzNFUgUferYPfNGUxOmM
="
,
"path"
:
"github.com/pingcap/tidb/sessionctx/stmtctx"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"kXyszfR2fQ6bHvuCCFlHRkt1mF0="
,
"path"
:
"github.com/pingcap/tidb/types"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"DWVD7+ygtT66IQ+cqXmMJ5OVqUk="
,
"path"
:
"github.com/pingcap/tidb/types/json"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"6vi/eCZXqNTa5eAUpxDZet4LPlY="
,
"path"
:
"github.com/pingcap/tidb/types/parser_driver"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"
s709bhSrG2Ec35406mGtrySid4s
="
,
"checksumSHA1"
:
"
SS7twHZofFKr8w/pwIKmkp3u5qU
="
,
"path"
:
"github.com/pingcap/tidb/util/execdetails"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"nUC7zVoAMNR2a+z2iGqHoN2AkFE="
,
"path"
:
"github.com/pingcap/tidb/util/hack"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"xSyepiuqsoaaeDch7cXeumvVHKM="
,
"path"
:
"github.com/pingcap/tidb/util/memory"
,
"revision"
:
"
ef7082da1cb2da10bee4ad70eb6ec9412bc96a90
"
,
"revisionTime"
:
"2018-12-2
2T14:19:41
Z"
"revision"
:
"
90b619a452cf203bbc804f934fa7ae798706789e
"
,
"revisionTime"
:
"2018-12-2
5T13:59:04
Z"
},
{
"checksumSHA1"
:
"SmYeIK/fIYXNu8IKxD6HOVQVTuU="
,
...
...
@@ -407,62 +407,62 @@
{
"checksumSHA1"
:
"aKn1oKcY74N8TRLm3Ayt7Q4bbI4="
,
"path"
:
"vitess.io/vitess/go/bytes2"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"JVCEN4UGRmg3TofIBdzZMZ3G0Ww="
,
"path"
:
"vitess.io/vitess/go/hack"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"F5pcGq+2W1FHEjgktTdKOE6W8mk="
,
"path"
:
"vitess.io/vitess/go/sqltypes"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"ntFIQYkBS51G6y+FEkjFW40+HOU="
,
"path"
:
"vitess.io/vitess/go/vt/log"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"tPQFPwbMdjuX0qjNl4Zl8zc37JQ="
,
"path"
:
"vitess.io/vitess/go/vt/proto/query"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"o0tR/c7lgr0pLkxk7CdvjiNDAKU="
,
"path"
:
"vitess.io/vitess/go/vt/proto/topodata"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"77UojBqi0yyeQvR70j7C3kcKclQ="
,
"path"
:
"vitess.io/vitess/go/vt/proto/vtgate"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"QpWGhoVDwM+8+sgYLI/YU+95iGU="
,
"path"
:
"vitess.io/vitess/go/vt/proto/vtrpc"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"IDe+9Bn42lZVsuoYO/epdguiErk="
,
"path"
:
"vitess.io/vitess/go/vt/sqlparser"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
},
{
"checksumSHA1"
:
"Jx+gOh/kiBDSZxEIWHyYn9brjdo="
,
"path"
:
"vitess.io/vitess/go/vt/vterrors"
,
"revision"
:
"
23f135ea6e773f3cc7c43c3d10c482b2221e9db9
"
,
"revisionTime"
:
"2018-12-2
2T19:18:51
Z"
"revision"
:
"
b90b3c0bee9198c345702cce56c31fd69505c334
"
,
"revisionTime"
:
"2018-12-2
4T22:04:56
Z"
}
],
"rootPath"
:
"github.com/XiaoMi/soar"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录