Skip to content

Commit

Permalink
bump tidb version (#755)
Browse files Browse the repository at this point in the history
close #756
  • Loading branch information
okJiang authored Dec 13, 2023
1 parent fab2a74 commit 0e38c78
Show file tree
Hide file tree
Showing 57 changed files with 630 additions and 702 deletions.
4 changes: 2 additions & 2 deletions dump_region/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (

"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/tidb-tools/pkg/utils"
"github.com/pingcap/tidb/tablecodec"
"github.com/pingcap/tidb/util/codec"
"github.com/pingcap/tidb/pkg/tablecodec"
"github.com/pingcap/tidb/pkg/util/codec"
pd "github.com/tikv/pd/client"
)

Expand Down
205 changes: 92 additions & 113 deletions go.mod

Large diffs are not rendered by default.

694 changes: 231 additions & 463 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/binlog-filter/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"strings"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/pkg/parser/ast"
)

// AstToDDLEvent returns filter.DDLEvent
Expand Down
8 changes: 4 additions & 4 deletions pkg/check/privilege.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (

"github.com/pingcap/errors"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/mysql"
_ "github.com/pingcap/tidb/types/parser_driver" // for parser driver
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/mysql"
_ "github.com/pingcap/tidb/pkg/types/parser_driver" // for parser driver
)

var (
Expand Down
8 changes: 4 additions & 4 deletions pkg/check/table_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/pingcap/errors"
column "github.com/pingcap/tidb-tools/pkg/column-mapping"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/charset"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/charset"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
)

// AutoIncrementKeyChecking is an identification for auto increment key checking
Expand Down
18 changes: 9 additions & 9 deletions pkg/dbutil/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import (
"github.com/go-sql-driver/mysql"
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/tidb/infoschema"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/model"
tmysql "github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/sessionctx/stmtctx"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/dbterror"
"github.com/pingcap/tidb/pkg/infoschema"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/model"
tmysql "github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/types"
contextutil "github.com/pingcap/tidb/pkg/util/context"
"github.com/pingcap/tidb/pkg/util/dbterror"
"go.uber.org/zap"

"github.com/pingcap/tidb-tools/pkg/utils"
Expand Down Expand Up @@ -596,8 +596,8 @@ func AnalyzeValuesFromBuckets(valueString string, cols []*model.ColumnInfo) ([]s
for i, col := range cols {
if IsTimeTypeAndNeedDecode(col.GetType()) {
// check if values[i] is already a time string
sc := &stmtctx.StatementContext{TimeZone: time.UTC}
_, err := types.ParseTime(sc, values[i], col.GetType(), types.MinFsp, nil)
typeCtx := types.NewContext(types.StrictFlags.WithIgnoreZeroInDate(true), time.UTC, contextutil.IgnoreWarn)
_, err := types.ParseTime(typeCtx, values[i], col.GetType(), types.MinFsp)
if err == nil {
continue
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/dbutil/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"github.com/go-sql-driver/mysql"
. "github.com/pingcap/check"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/infoschema"
"github.com/pingcap/tidb/parser/model"
pmysql "github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/types"
"github.com/pingcap/tidb/pkg/infoschema"
"github.com/pingcap/tidb/pkg/parser/model"
pmysql "github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/types"
)

func (*testDBSuite) TestReplacePlaceholder(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbutil/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/parser/model"
)

// IndexInfo contains information of table index.
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbutil/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package dbutil

import (
. "github.com/pingcap/check"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/pkg/parser"
)

func (*testDBSuite) TestIndex(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbutil/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/go-sql-driver/mysql"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/errno"
"github.com/pingcap/tidb/pkg/errno"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbutil/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/go-sql-driver/mysql"
. "github.com/pingcap/check"
"github.com/pingcap/tidb/errno"
"github.com/pingcap/tidb/pkg/errno"
)

var _ = Suite(&testRetrySuite{})
Expand Down
22 changes: 11 additions & 11 deletions pkg/dbutil/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ import (

"github.com/coreos/go-semver/semver"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/ddl"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/mysql"
_ "github.com/pingcap/tidb/planner/core" // to setup expression.EvalAstExpr. See: https://github.com/pingcap/tidb/blob/a94cff903cd1e7f3b050db782da84273ef5592f4/planner/core/optimizer.go#L202
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/types"
_ "github.com/pingcap/tidb/types/parser_driver" // for parser driver
"github.com/pingcap/tidb/util/collate"
"github.com/pingcap/tidb/util/mock"
"github.com/pingcap/tidb/pkg/ddl"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
_ "github.com/pingcap/tidb/pkg/planner/core" // to setup expression.EvalAstExpr. See: https://github.com/pingcap/tidb/blob/a94cff903cd1e7f3b050db782da84273ef5592f4/planner/core/optimizer.go#L202
"github.com/pingcap/tidb/pkg/sessionctx"
"github.com/pingcap/tidb/pkg/types"
_ "github.com/pingcap/tidb/pkg/types/parser_driver" // for parser driver
"github.com/pingcap/tidb/pkg/util/collate"
"github.com/pingcap/tidb/pkg/util/mock"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/dbutil/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"testing"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/types"

"github.com/pingcap/tidb-tools/pkg/schemacmp"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/dbutil/types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dbutil

import (
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/mysql"
)

// IsNumberType returns true if tp is number type
Expand Down
6 changes: 3 additions & 3 deletions pkg/dbutil/variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/auth"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/auth"
)

// ShowVersion queries variable 'version' and returns its value.
Expand Down
13 changes: 7 additions & 6 deletions pkg/ddl-checker/executable_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ import (

"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/store/mockstore"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/session"
"github.com/pingcap/tidb/pkg/session/types"
"github.com/pingcap/tidb/pkg/store/mockstore"
"github.com/pingcap/tidb/pkg/util/logutil"
"go.uber.org/atomic"
)

// ExecutableChecker is a part of TiDB to check the sql's executability
type ExecutableChecker struct {
session session.Session
session types.Session
parser *parser.Parser
isClosed *atomic.Bool
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb-tools/pkg/utils"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/parser/model"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb-tools/pkg/utils"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/parser/model"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/pingcap/failpoint"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb-tools/pkg/importer"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/pkg/parser"
)

func TestClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/parser/model"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

. "github.com/pingcap/check"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/pkg/parser"
)

var _ = Suite(&testMergerSuite{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/diff/spliter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
sqlmock "github.com/DATA-DOG/go-sqlmock"
. "github.com/pingcap/check"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/pkg/parser"
)

var _ = Suite(&testSpliterSuite{})
Expand Down
4 changes: 2 additions & 2 deletions pkg/diff/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb-tools/pkg/utils"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/types"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/diff/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package diff
import (
. "github.com/pingcap/check"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/model"
)

var _ = Suite(&testUtilSuite{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/importer/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/mysql"
"go.uber.org/zap"
)

Expand Down
8 changes: 4 additions & 4 deletions pkg/importer/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/tidb-tools/pkg/dbutil"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/types"
_ "github.com/pingcap/tidb/types/parser_driver" // for parser driver
"github.com/pingcap/tidb/pkg/parser"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/types"
_ "github.com/pingcap/tidb/pkg/types/parser_driver" // for parser driver
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/regexpr-router/regexpr_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/pingcap/errors"
"github.com/pingcap/tidb-tools/pkg/filter"
router "github.com/pingcap/tidb/util/table-router"
router "github.com/pingcap/tidb/pkg/util/table-router"
)

type FilterType = int32
Expand Down
2 changes: 1 addition & 1 deletion pkg/regexpr-router/regexpr_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

. "github.com/pingcap/check"
"github.com/pingcap/tidb-tools/pkg/filter"
router "github.com/pingcap/tidb/util/table-router"
router "github.com/pingcap/tidb/pkg/util/table-router"
)

var _ = Suite(&testRouteSuite{})
Expand Down
8 changes: 4 additions & 4 deletions pkg/schemacmp/lattice.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package schemacmp
import (
"fmt"

"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/types"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/types"
)

type IncompatibleError struct {
Expand Down Expand Up @@ -290,12 +290,12 @@ func (a Byte) Join(other Lattice) (Lattice, error) {
}

// fieldTp is a mysql column field type implementing lattice.
// It is used for the column field type (`github.com/pingcap/tidb/parser/types.FieldType.Tp`).
// It is used for the column field type (`github.com/pingcap/tidb/pkg/parser/types.FieldType.Tp`).
type fieldTp struct {
value byte
}

// FieldTp is used for the column field type (`github.com/pingcap/tidb/parser/types.FieldType.Tp`).
// FieldTp is used for the column field type (`github.com/pingcap/tidb/pkg/parser/types.FieldType.Tp`).
func FieldTp(value byte) Lattice {
return fieldTp{value: value}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/schemacmp/lattice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"bytes"

. "github.com/pingcap/check"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/mysql"

. "github.com/pingcap/tidb-tools/pkg/schemacmp"
)
Expand Down
8 changes: 4 additions & 4 deletions pkg/schemacmp/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
"sort"
"strings"

"github.com/pingcap/tidb/parser/format"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/types"
"github.com/pingcap/tidb/pkg/parser/format"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/parser/types"
)

const (
Expand Down
Loading

0 comments on commit 0e38c78

Please sign in to comment.