Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: bump client-go with some regression tests #57282

Merged
merged 13 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5776,13 +5776,13 @@ def go_deps():
name = "com_github_pingcap_kvproto",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/kvproto",
sha256 = "6f2a7d747d05ae61a8f4a3c066058fa69f724480f8dc4a427d66fd066ce730c7",
strip_prefix = "github.com/pingcap/[email protected]20240924080114-4a3e17f5e62d",
sha256 = "d470ef683433f2c5bc7a1e610da44d516908d326a0341c07208af76a30f0d8a6",
strip_prefix = "github.com/pingcap/[email protected]20241113043844-e1fa7ea8c302",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240924080114-4a3e17f5e62d.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240924080114-4a3e17f5e62d.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240924080114-4a3e17f5e62d.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20240924080114-4a3e17f5e62d.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
"http://ats.apps.svc/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
"https://cache.hawkingrei.com/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/pingcap/kvproto/com_github_pingcap_kvproto-v0.0.0-20241113043844-e1fa7ea8c302.zip",
],
)
go_repository(
Expand Down Expand Up @@ -6933,13 +6933,13 @@ def go_deps():
name = "com_github_tikv_client_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/tikv/client-go/v2",
sha256 = "537e3204b8178e2ce0ce43c744fc2699883bb33e718e267da2f1dd6c389968c2",
strip_prefix = "github.com/tikv/client-go/[email protected].20241111090227-70049ae310bf",
sha256 = "4bc779621156c4ee6f46b57235da9c34c8ec0ee6d3be5f52e33da4c47098eeed",
strip_prefix = "github.com/tikv/client-go/[email protected].20241120024459-05d115b3e88b",
urls = [
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241111090227-70049ae310bf.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241111090227-70049ae310bf.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241111090227-70049ae310bf.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241111090227-70049ae310bf.zip",
"http://bazel-cache.pingcap.net:8080/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
"http://ats.apps.svc/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
"https://cache.hawkingrei.com/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
"https://storage.googleapis.com/pingcapmirror/gomod/github.com/tikv/client-go/v2/com_github_tikv_client_go_v2-v2.0.8-0.20241120024459-05d115b3e88b.zip",
],
)
go_repository(
Expand Down
5 changes: 5 additions & 0 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,11 @@ error = '''
not implemented
'''

["kv:8178"]
error = '''
key is too large, the size of given key is %d
'''

["kv:9007"]
error = '''
Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s%s%s%s, reason=%s [try again later]
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ require (
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/fn v1.0.0
github.com/pingcap/kvproto v0.0.0-20240924080114-4a3e17f5e62d
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
github.com/pingcap/tidb/pkg/parser v0.0.0-20211011031125-9b13dc409c5e
Expand All @@ -110,7 +110,7 @@ require (
github.com/tdakkota/asciicheck v0.2.0
github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2
github.com/tidwall/btree v1.7.0
github.com/tikv/client-go/v2 v2.0.8-0.20241111090227-70049ae310bf
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a
github.com/twmb/murmur3 v1.1.6
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ github.com/pingcap/fn v1.0.0/go.mod h1:u9WZ1ZiOD1RpNhcI42RucFh/lBuzTu6rw88a+oF2Z
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 h1:surzm05a8C9dN8dIUmo4Be2+pMRb6f55i+UIYrluu2E=
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
github.com/pingcap/kvproto v0.0.0-20240924080114-4a3e17f5e62d h1:vSdKTrF6kpcd56G5BLP0Bz88Nho2tDo7IR1+oSsBAfc=
github.com/pingcap/kvproto v0.0.0-20240924080114-4a3e17f5e62d/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302 h1:ynwwqr0rLliSOJcx0wHMu4T/NiPXHlK48mk2DCrBKCI=
github.com/pingcap/kvproto v0.0.0-20241113043844-e1fa7ea8c302/go.mod h1:rXxWk2UnwfUhLXha1jxRWPADw9eMZGWEWCg92Tgmb/8=
github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM=
github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4=
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d h1:y3EueKVfVykdpTyfUnQGqft0ud+xVFuCdp1XkVL0X1E=
Expand Down Expand Up @@ -826,8 +826,8 @@ github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a h1:J/YdBZ46WKpXsxsW
github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a/go.mod h1:h4xBhSNtOeEosLJ4P7JyKXX7Cabg7AVkWCK5gV2vOrM=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tikv/client-go/v2 v2.0.8-0.20241111090227-70049ae310bf h1:qCi6BiBUPk3Ky4f2CCgBxgUmi3ZpuQLYDLgxw1ilXPA=
github.com/tikv/client-go/v2 v2.0.8-0.20241111090227-70049ae310bf/go.mod h1:p9zPFlKBrxhp3b/cBmKBWL9M0X4HtJjgi1ThUtQYF7o=
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b h1:/hmt2FCt34rCVBX9dswiSdHOkppP67VWaESryTxDKc8=
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b/go.mod h1:NI2GfVlB9n7DsIGCxrKcD4psrcuFNEV8m1BgyzK1Amc=
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31 h1:oAYc4m5Eu1OY9ogJ103VO47AYPHvhtzbUPD8L8B67Qk=
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31/go.mod h1:W5a0sDadwUpI9k8p7M77d3jo253ZHdmua+u4Ho4Xw8U=
github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo=
Expand Down
1 change: 1 addition & 0 deletions pkg/errno/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ const (
ErrMemoryExceedForQuery = 8175
ErrMemoryExceedForInstance = 8176
ErrDeleteNotFoundColumn = 8177
ErrKeyTooLarge = 8178

// Error codes used by TiDB ddl package
ErrUnsupportedDDLOperation = 8200
Expand Down
4 changes: 3 additions & 1 deletion pkg/errno/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,9 @@ var MySQLErrName = map[uint16]*mysql.ErrMessage{
ErrMemoryExceedForQuery: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for a single SQL query. Please try narrowing your query scope or increase the tidb_mem_quota_query limit and try again.[conn=%d]", nil),
ErrMemoryExceedForInstance: mysql.Message("Your query has been cancelled due to exceeding the allowed memory limit for the tidb-server instance and this query is currently using the most memory. Please try narrowing your query scope or increase the tidb_server_memory_limit and try again.[conn=%d]", nil),
ErrDeleteNotFoundColumn: mysql.Message("Delete can not find column %s for table %s", nil),
ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil),
ErrKeyTooLarge: mysql.Message("key is too large, the size of given key is %d", nil),

ErrHTTPServiceError: mysql.Message("HTTP request failed with status %s", nil),

ErrWarnOptimizerHintInvalidInteger: mysql.Message("integer value is out of range in '%s'", nil),
ErrWarnOptimizerHintUnsupportedHint: mysql.Message("Optimizer hint %s is not supported by TiDB and is ignored", nil),
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ func (a *ExecStmt) handleStmtForeignKeyTrigger(ctx context.Context, e exec.Execu
if stmtCtx.ForeignKeyTriggerCtx.HasFKCascades {
// If the ExecStmt has foreign key cascade to be executed, we need call `StmtCommit` to commit the ExecStmt itself
// change first.
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
// Since `UnionScanExec` use `SnapshotIter` and `SnapshotGetter` to read txn mem-buffer, if we don't do `StmtCommit`,
// then the fk cascade executor can't read the mem-buffer changed by the ExecStmt.
a.Ctx.StmtCommit(ctx)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/executor_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestBuildKvRangesForIndexJoinWithoutCwcAndWithMemoryTracker(t *testing.T) {
}

require.Equal(t, 2*bytesConsumed1, bytesConsumed2)
require.Equal(t, int64(25560), bytesConsumed1)
require.Equal(t, int64(23640), bytesConsumed1)
}

func generateIndexRange(vals ...int64) *ranger.Range {
Expand Down
23 changes: 20 additions & 3 deletions pkg/executor/mem_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ func (iter *txnMemBufferIter) Valid() bool {
if iter.curr.Valid() {
return true
}
iter.curr = nil
iter.idx++
}
for iter.idx < len(iter.kvRanges) {
Expand All @@ -372,7 +371,6 @@ func (iter *txnMemBufferIter) Valid() bool {
if iter.curr.Valid() {
return true
}
iter.curr = nil
iter.idx++
}
return false
Expand All @@ -398,7 +396,10 @@ func (iter *txnMemBufferIter) Value() []byte {
return iter.curr.Value()
}

func (*txnMemBufferIter) Close() {
func (iter *txnMemBufferIter) Close() {
if iter.curr != nil {
iter.curr.Close()
}
}

func (m *memTableReader) getMemRowsIter(ctx context.Context) (memRowsIter, error) {
Expand Down Expand Up @@ -882,6 +883,8 @@ func buildMemIndexMergeReader(ctx context.Context, us *UnionScanExec, indexMerge

type memRowsIter interface {
Next() ([]types.Datum, error)
// Close will release the snapshot it holds, so be sure to call Close.
Close()
cfzjywxk marked this conversation as resolved.
Show resolved Hide resolved
}

type defaultRowsIter struct {
Expand All @@ -898,6 +901,8 @@ func (iter *defaultRowsIter) Next() ([]types.Datum, error) {
return nil, nil
}

func (*defaultRowsIter) Close() {}

// memRowsIterForTable combine a kv.Iterator and a kv decoder to get a memRowsIter.
type memRowsIterForTable struct {
kvIter *txnMemBufferIter // txnMemBufferIter is the kv.Iterator
Expand Down Expand Up @@ -966,6 +971,12 @@ func (iter *memRowsIterForTable) Next() ([]types.Datum, error) {
return ret, nil
}

func (iter *memRowsIterForTable) Close() {
if iter.kvIter != nil {
iter.kvIter.Close()
}
}

type memRowsIterForIndex struct {
kvIter *txnMemBufferIter
tps []*types.FieldType
Expand Down Expand Up @@ -1018,6 +1029,12 @@ func (iter *memRowsIterForIndex) Next() ([]types.Datum, error) {
return ret, nil
}

func (iter *memRowsIterForIndex) Close() {
if iter.kvIter != nil {
iter.kvIter.Close()
}
}

func (m *memIndexMergeReader) getMemRowsIter(ctx context.Context) (memRowsIter, error) {
data, err := m.getMemRows(ctx)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/executor/union_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ func (us *UnionScanExec) Close() error {
us.cursor4AddRows = nil
us.cursor4SnapshotRows = 0
us.snapshotRows = us.snapshotRows[:0]
if us.addedRowsIter != nil {
us.addedRowsIter.Close()
}
return exec.Close(us.Children(0))
}

Expand Down
15 changes: 15 additions & 0 deletions pkg/executor/union_scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,21 @@ func TestIssue32422(t *testing.T) {
tk.MustExec("rollback")
}

func TestSnapshotWithConcurrentWrite(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table t1 (id int auto_increment key, b int, index(b));")

tk.MustExec("begin")
tk.MustExec("insert into t1 (b) values (1),(2),(3),(4),(5),(6),(7),(8);")
for j := 0; j < 16; j++ {
tk.MustExec("insert into t1 (b) select /*+ use_index(t1, b) */ id from t1;")
}
tk.MustQuery("select count(1) from t1").Check(testkit.Rows("524288")) // 8 * 2^16 rows
tk.MustExec("rollback")
}

func BenchmarkUnionScanRead(b *testing.B) {
store := testkit.CreateMockStore(b)

Expand Down
2 changes: 2 additions & 0 deletions pkg/kv/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ var (
ErrTxnTooLarge = dbterror.ClassKV.NewStd(mysql.ErrTxnTooLarge)
// ErrEntryTooLarge is the error when a key value entry is too large.
ErrEntryTooLarge = dbterror.ClassKV.NewStd(mysql.ErrEntryTooLarge)
// ErrKeyTooLarge is the error when a key is too large to be handled by MemBuffer.
ErrKeyTooLarge = dbterror.ClassKV.NewStd(mysql.ErrKeyTooLarge)
// ErrKeyExists returns when key is already exist. Caller should try to use
// GenKeyExistsErr to generate this error for correct format.
ErrKeyExists = dbterror.ClassKV.NewStd(mysql.ErrDupEntry)
Expand Down
6 changes: 1 addition & 5 deletions pkg/kv/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ func (k Key) String() string {
type KeyRange struct {
StartKey Key
EndKey Key

XXXNoUnkeyedLiteral struct{}
XXXunrecognized []byte
XXXsizecache int32
}

// KeyRangeSliceMemUsage return the memory usage of []KeyRange
Expand All @@ -110,7 +106,7 @@ func KeyRangeSliceMemUsage(k []KeyRange) int64 {

res := sizeofKeyRange * int64(cap(k))
for _, m := range k {
res += int64(cap(m.StartKey)) + int64(cap(m.EndKey)) + int64(cap(m.XXXunrecognized))
res += int64(cap(m.StartKey)) + int64(cap(m.EndKey))
}

return res
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func TestKeyRangeDefinition(t *testing.T) {
StartKey: []byte("s2"),
EndKey: []byte("e2"),
}}
require.Equal(t, int64(168), KeyRangeSliceMemUsage(s))
require.Equal(t, int64(104), KeyRangeSliceMemUsage(s))
}

func BenchmarkIsPoint(b *testing.B) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/session/test/txn/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_test(
],
flaky = True,
race = "on",
shard_count = 9,
shard_count = 10,
deps = [
"//pkg/config",
"//pkg/kv",
Expand Down
26 changes: 26 additions & 0 deletions pkg/session/test/txn/txn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,3 +553,29 @@ func TestMemBufferSnapshotRead(t *testing.T) {
tk.MustExec("set session tidb_max_chunk_size=default;")
tk.MustExec("set session tidb_index_join_batch_size = default")
}

func TestMemBufferCleanupMemoryLeak(t *testing.T) {
// Test if cleanup memory will cause a memory leak.
// When an in-txn statement fails, TiDB cleans up the mutations from this statement.
// If there's a memory leak, the memory usage could increase uncontrollably with retries.
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table t(a varchar(255) primary key)")
key1 := strings.Repeat("a", 255)
key2 := strings.Repeat("b", 255)
tk.MustExec(`set global tidb_mem_oom_action='cancel'`)
tk.MustExec("set session tidb_mem_quota_query=10240")
tk.MustExec("begin")
tk.MustExec("insert into t values(?)", key2)
for i := 0; i < 100; i++ {
// The insert statement will fail because of the duplicate key error.
err := tk.ExecToErr("insert into t values(?), (?)", key1, key2)
require.Error(t, err)
if strings.Contains(err.Error(), "Duplicate") {
continue
}
require.NoError(t, err)
}
tk.MustExec("commit")
}
5 changes: 5 additions & 0 deletions pkg/store/driver/error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ func ToTiDBErr(err error) error {
return kv.ErrEntryTooLarge.GenWithStackByArgs(entryTooLarge.Limit, entryTooLarge.Size)
}

var keyTooLarge *tikverr.ErrKeyTooLarge
if stderrs.As(err, &keyTooLarge) {
return kv.ErrKeyTooLarge.GenWithStackByArgs(keyTooLarge.KeySize)
}

if stderrs.Is(err, tikverr.ErrInvalidTxn) {
return kv.ErrInvalidTxn
}
Expand Down
14 changes: 14 additions & 0 deletions pkg/store/driver/error/error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package error //nolint: predeclared

import (
"math"
"testing"

"github.com/pingcap/errors"
Expand Down Expand Up @@ -52,3 +53,16 @@ func TestConvertError(t *testing.T) {
assert.True(t, errors.ErrorEqual(tidbErr, terror.ErrResultUndetermined))
}
}

func TestMemBufferOversizeError(t *testing.T) {
err2str := map[error]string{
&tikverr.ErrTxnTooLarge{Size: 100}: "Transaction is too large, size: 100",
&tikverr.ErrEntryTooLarge{Limit: 10, Size: 20}: "entry too large, the max entry size is 10, the size of data is 20",
&tikverr.ErrKeyTooLarge{KeySize: math.MaxUint16 + 1}: "key is too large, the size of given key is 65536",
}
for err, errString := range err2str {
tidbErr := ToTiDBErr(err)
assert.NotNil(t, tidbErr)
assert.Contains(t, tidbErr.Error(), errString)
}
}
5 changes: 4 additions & 1 deletion tests/integrationtest/r/executor/ddl.result
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,10 @@ create or replace definer='root'@'localhost' view v_nested as select * from v_ne
Error 1146 (42S02): Table 'executor__ddl.v_nested' doesn't exist
drop table test_v_nested;
drop view v_nested, v_nested2;
create view v_stale as select * from source_table as of timestamp current_timestamp(3);
select sleep(1);
sleep(1)
0
create view v_stale as select * from source_table as of timestamp date_sub(current_timestamp(3), interval 1 second);
Error 1356 (HY000): View 'executor__ddl.v_stale' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view if exists v1,v2;
drop table if exists t1;
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtest/r/globalindex/insert.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ a b
1 3
alter table t add unique index idx1(b) global;
insert into t values (2, 4), (3, 4) on duplicate key update a=2, b=5;
select * from t use index (idx1);
select * from t use index (idx1) order by a desc;
a b
2 5
1 3
3 changes: 2 additions & 1 deletion tests/integrationtest/t/executor/ddl.test
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ create or replace definer='root'@'localhost' view v_nested as select * from v_ne
drop table test_v_nested;
drop view v_nested, v_nested2;
## Refer https://github.com/pingcap/tidb/issues/25876
select sleep(1);
-- error 1356
create view v_stale as select * from source_table as of timestamp current_timestamp(3);
create view v_stale as select * from source_table as of timestamp date_sub(current_timestamp(3), interval 1 second);
## Refer https://github.com/pingcap/tidb/issues/32682
drop view if exists v1,v2;
drop table if exists t1;
Expand Down
2 changes: 1 addition & 1 deletion tests/integrationtest/t/globalindex/insert.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ select * from t use index (idx);

alter table t add unique index idx1(b) global;
insert into t values (2, 4), (3, 4) on duplicate key update a=2, b=5;
select * from t use index (idx1);
select * from t use index (idx1) order by a desc;