From 7d37fab7bb55a9a071a0e9d7d243946a8f5d49cb Mon Sep 17 00:00:00 2001 From: Leon Zhang Date: Mon, 23 Sep 2019 21:20:49 +0800 Subject: [PATCH] update vendor --- .../pingcap/parser/ast/functions.go | 3 + .../tidb/sessionctx/stmtctx/stmtctx.go | 16 +++ vendor/github.com/pingcap/tidb/types/datum.go | 44 ++++++ vendor/github.com/pingcap/tidb/types/time.go | 6 +- .../github.com/pingcap/tidb/util/hack/hack.go | 11 +- .../pingcap/tidb/util/memory/tracker.go | 6 + vendor/vendor.json | 130 +++++++++--------- 7 files changed, 147 insertions(+), 69 deletions(-) diff --git a/vendor/github.com/pingcap/parser/ast/functions.go b/vendor/github.com/pingcap/parser/ast/functions.go index 6a1f940..74f09bf 100755 --- a/vendor/github.com/pingcap/parser/ast/functions.go +++ b/vendor/github.com/pingcap/parser/ast/functions.go @@ -321,6 +321,9 @@ const ( JSONDepth = "json_depth" JSONKeys = "json_keys" JSONLength = "json_length" + + // TiDB internal function. + TiDBDecodeKey = "tidb_decode_key" ) // FuncCallExpr is for function expression. diff --git a/vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go b/vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go index a7ef3c7..80fc128 100644 --- a/vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go +++ b/vendor/github.com/pingcap/tidb/sessionctx/stmtctx/stmtctx.go @@ -47,6 +47,7 @@ type SQLWarn struct { // It should be reset before executing a statement. type StatementContext struct { // Set the following variables before execution + StmtHints // IsDDLJobInQueue is used to mark whether the DDL job is put into the queue. // If IsDDLJobInQueue is true, it means the DDL job is in the queue of storage, and it can be handled by the DDL worker. @@ -137,6 +138,21 @@ type StatementContext struct { Tables []TableEntry } +// StmtHints are SessionVars related sql hints. +type StmtHints struct { + // Hint flags + HasAllowInSubqToJoinAndAggHint bool + HasEnableIndexMergeHint bool + HasMemQuotaHint bool + HasReplicaReadHint bool + + // Hint Information + AllowInSubqToJoinAndAgg bool + EnableIndexMerge bool + MemQuotaQuery int64 + ReplicaRead byte +} + // GetNowTsCached getter for nowTs, if not set get now time and cache it func (sc *StatementContext) GetNowTsCached() time.Time { if !sc.stmtTimeCached { diff --git a/vendor/github.com/pingcap/tidb/types/datum.go b/vendor/github.com/pingcap/tidb/types/datum.go index 5e448d7..c5b4711 100644 --- a/vendor/github.com/pingcap/tidb/types/datum.go +++ b/vendor/github.com/pingcap/tidb/types/datum.go @@ -341,6 +341,50 @@ func (d *Datum) SetAutoID(id int64, flag uint) { } } +// String returns a human-readable description of Datum. It is intended only for debugging. +func (d Datum) String() string { + var t string + switch d.k { + case KindNull: + t = "KindNull" + case KindInt64: + t = "KindInt64" + case KindUint64: + t = "KindUint64" + case KindFloat32: + t = "KindFloat32" + case KindFloat64: + t = "KindFloat64" + case KindString: + t = "KindString" + case KindBytes: + t = "KindBytes" + case KindMysqlDecimal: + t = "KindMysqlDecimal" + case KindMysqlDuration: + t = "KindMysqlDuration" + case KindMysqlEnum: + t = "KindMysqlEnum" + case KindBinaryLiteral: + t = "KindBinaryLiteral" + case KindMysqlBit: + t = "KindMysqlBit" + case KindMysqlSet: + t = "KindMysqlSet" + case KindMysqlJSON: + t = "KindMysqlJSON" + case KindMysqlTime: + t = "KindMysqlTime" + default: + t = "Unknown" + } + v := d.GetValue() + if b, ok := v.([]byte); ok && d.k == KindBytes { + v = string(b) + } + return fmt.Sprintf("%v %v", t, v) +} + // GetValue gets the value of the datum of any kind. func (d *Datum) GetValue() interface{} { switch d.k { diff --git a/vendor/github.com/pingcap/tidb/types/time.go b/vendor/github.com/pingcap/tidb/types/time.go index dbb8b12..0a34b4f 100644 --- a/vendor/github.com/pingcap/tidb/types/time.go +++ b/vendor/github.com/pingcap/tidb/types/time.go @@ -194,10 +194,12 @@ const ( // FromGoTime translates time.Time to mysql time internal representation. func FromGoTime(t gotime.Time) MysqlTime { + // Plus 500 nanosecond for rounding of the millisecond part. + t = t.Add(500 * gotime.Nanosecond) + year, month, day := t.Date() hour, minute, second := t.Clock() - // Nanosecond plus 500 then divided 1000 means rounding to microseconds. - microsecond := (t.Nanosecond() + 500) / 1000 + microsecond := t.Nanosecond() / 1000 return FromDate(year, int(month), day, hour, minute, second, microsecond) } diff --git a/vendor/github.com/pingcap/tidb/util/hack/hack.go b/vendor/github.com/pingcap/tidb/util/hack/hack.go index b129c86..ac59b77 100644 --- a/vendor/github.com/pingcap/tidb/util/hack/hack.go +++ b/vendor/github.com/pingcap/tidb/util/hack/hack.go @@ -24,8 +24,15 @@ type MutableString string // String converts slice to MutableString without copy. // The MutableString can be converts to string without copy. // Use it at your own risk. -func String(b []byte) MutableString { - return *(*MutableString)(unsafe.Pointer(&b)) +func String(b []byte) (s MutableString) { + if len(b) == 0 { + return "" + } + pbytes := (*reflect.SliceHeader)(unsafe.Pointer(&b)) + pstring := (*reflect.StringHeader)(unsafe.Pointer(&s)) + pstring.Data = pbytes.Data + pstring.Len = pbytes.Len + return } // Slice converts string to slice without copy. diff --git a/vendor/github.com/pingcap/tidb/util/memory/tracker.go b/vendor/github.com/pingcap/tidb/util/memory/tracker.go index 003a186..9ffda11 100644 --- a/vendor/github.com/pingcap/tidb/util/memory/tracker.go +++ b/vendor/github.com/pingcap/tidb/util/memory/tracker.go @@ -62,6 +62,12 @@ func NewTracker(label fmt.Stringer, bytesLimit int64) *Tracker { } } +// CheckBytesLimit check whether the bytes limit of the tracker is equal to a value. +// Only used in test. +func (t *Tracker) CheckBytesLimit(val int64) bool { + return t.bytesLimit == val +} + // SetBytesLimit sets the bytes limit for this tracker. // "bytesLimit <= 0" means no limit. func (t *Tracker) SetBytesLimit(bytesLimit int64) { diff --git a/vendor/vendor.json b/vendor/vendor.json index c25d1e9..6a595d2 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -131,116 +131,116 @@ { "checksumSHA1": "6Q3DjwHqeCoRIxBT+Jy5ctnK6hw=", "path": "github.com/pingcap/parser", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { - "checksumSHA1": "QDkkRc/x4HH3FdHZ9pLPgeAw9+A=", + "checksumSHA1": "2zFL4KJXdxL9LvQ/HNQhUDNIMd4=", "path": "github.com/pingcap/parser/ast", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "xiv40YqnvHcbIhaEzJqjh5K7ehM=", "path": "github.com/pingcap/parser/auth", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "EvDXpplklIXmKqLclzWzaN/uHKQ=", "path": "github.com/pingcap/parser/charset", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "Aao6Mul/qqogOwPwM2arBKZkYZs=", "path": "github.com/pingcap/parser/format", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "GAJ7IUg0t8DCKJbJQxJLkklEj2E=", "path": "github.com/pingcap/parser/model", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "pN8v8r1syhLlLXw9TOq6bFgJfnY=", "path": "github.com/pingcap/parser/mysql", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "olapD16WCMBU9vrA5PtlERGFfXw=", "path": "github.com/pingcap/parser/opcode", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "L6rzy3sJU1RPf7AkJN+0zcwW/YY=", "path": "github.com/pingcap/parser/terror", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { "checksumSHA1": "u1Lmm4Fa3su4ElZMN4w0hPzFZl4=", "path": "github.com/pingcap/parser/types", - "revision": "978b8272c04e599620715e8493ca26775e8c0e5f", - "revisionTime": "2019-09-12T03:26:24Z" + "revision": "33636bc5e5d6c114f4b443dee71ff72645656d96", + "revisionTime": "2019-09-23T03:17:04Z" }, { - "checksumSHA1": "ryt2yutvbgdMuS5uvtaiJqqvZXQ=", + "checksumSHA1": "MqOvmeZKNG2g9yh3KS7WR18zhnM=", "path": "github.com/pingcap/tidb/sessionctx/stmtctx", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { - "checksumSHA1": "xqDC/XGpST9lvxuOJt4+LkXOvnw=", + "checksumSHA1": "E3tVZMdsoBoN+PbIBTd0hqxsHXA=", "path": "github.com/pingcap/tidb/types", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "OSOQVeP518zWu3RoYSDWoh7DIjg=", "path": "github.com/pingcap/tidb/types/json", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "45zWX5Q6D6aTEWtc4p/lbD9WD4o=", "path": "github.com/pingcap/tidb/types/parser_driver", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "oCrNchmOGNQTnrkjk5CxFZpu2rE=", "path": "github.com/pingcap/tidb/util/execdetails", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { - "checksumSHA1": "zw1limoYLowZjRm8wgicyjC72+U=", + "checksumSHA1": "QGCTegCx13wJyB0isXsV7mNIljE=", "path": "github.com/pingcap/tidb/util/hack", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "SZhLPQR66Rd4kWkva6W3sJmSNLY=", "path": "github.com/pingcap/tidb/util/logutil", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "OveQu0ABBJmMEwmmthqSRQC2Ef0=", "path": "github.com/pingcap/tidb/util/math", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { - "checksumSHA1": "YCueNgfYAVAWPgnLF2tBu7ikN1g=", + "checksumSHA1": "wtzRvG5v1M4goFuWvP8ohkcZaT0=", "path": "github.com/pingcap/tidb/util/memory", - "revision": "4e545cfa580a38dfd31946f2ecad3f459f9ceaee", - "revisionTime": "2019-09-16T09:47:52Z" + "revision": "582076b5cc9e0743bdd4aa95fbfd2ca1cc0e86e0", + "revisionTime": "2019-09-23T07:09:15Z" }, { "checksumSHA1": "QPIBwDNUFF5Whrnd41S3mkKa4gQ=", @@ -497,68 +497,68 @@ { "checksumSHA1": "aKn1oKcY74N8TRLm3Ayt7Q4bbI4=", "path": "vitess.io/vitess/go/bytes2", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "bhE6CGQgZTIgLPp9lnvlKW/47xc=", "path": "vitess.io/vitess/go/hack", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "IpNRu9mF+hsO3XRHzhW2Tz4G81o=", "path": "vitess.io/vitess/go/sqltypes", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "vAIRxI6MHsq3x1hLQwIyw5AvqtI=", "path": "vitess.io/vitess/go/vt/log", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "//MHnGEq9xApvIMdwQaRrQf5ZWo=", "path": "vitess.io/vitess/go/vt/proto/binlogdata", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "u8uuZWMqaXgQ1MduggrgIHU50FI=", "path": "vitess.io/vitess/go/vt/proto/query", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "rJ1Iqz/lvaKikIUx4oEFfYJtoBQ=", "path": "vitess.io/vitess/go/vt/proto/topodata", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "Bv8lucvoH9AnJSYiWX8MIrJl4zY=", "path": "vitess.io/vitess/go/vt/proto/vtgate", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "HeUJu5njPq9iznpAOcrLpLD7f9w=", "path": "vitess.io/vitess/go/vt/proto/vtrpc", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "QP+KJhlTW4o4uRt2uFFiI9tjriI=", "path": "vitess.io/vitess/go/vt/sqlparser", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" }, { "checksumSHA1": "z9+F/lA1Xrl5S16LKssUH8VL6hs=", "path": "vitess.io/vitess/go/vt/vterrors", - "revision": "521e55710e066343d8234470e88601ddf2b169d4", - "revisionTime": "2019-09-16T06:01:21Z" + "revision": "909d0c8861b2b1a4a5942f99e7b44bf38e5db503", + "revisionTime": "2019-09-23T01:36:26Z" } ], "rootPath": "github.com/XiaoMi/soar" -- GitLab