Skip to content

Commit

Permalink
remove dependency stmtctx from dbutil
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
  • Loading branch information
YangKeao committed Nov 27, 2023
1 parent 2e277dc commit c4ddf61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion pkg/util/dbutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ go_library(
"//pkg/parser/model",
"//pkg/parser/mysql",
"//pkg/planner/core",
"//pkg/sessionctx/stmtctx",
"//pkg/types",
"//pkg/types/parser_driver",
"//pkg/util",
Expand Down
4 changes: 1 addition & 3 deletions pkg/util/dbutil/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"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/sessionctx/stmtctx"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/dbterror"
Expand Down Expand Up @@ -550,8 +549,7 @@ 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.NewStmtCtxWithTimeZone(time.UTC)
_, err := types.ParseTime(sc.TypeCtx(), values[i], col.GetType(), types.MinFsp)
_, err := types.ParseTime(types.DefaultStmtNoWarningContext, values[i], col.GetType(), types.MinFsp)
if err == nil {
continue
}
Expand Down

0 comments on commit c4ddf61

Please sign in to comment.