Skip to content

Commit

Permalink
This is an automated cherry-pick of #55477
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
joechenrh authored and ti-chi-bot committed Dec 6, 2024
1 parent 858ba74 commit 7667400
Show file tree
Hide file tree
Showing 23 changed files with 20,975 additions and 0 deletions.
13 changes: 13 additions & 0 deletions expression/builtin_miscellaneous_vec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@ func TestSleepVectorized(t *testing.T) {
warnCnt := counter{}

// non-strict model
<<<<<<< HEAD:expression/builtin_miscellaneous_vec_test.go
sessVars.StmtCtx.BadNullAsWarning = true
=======
var levels errctx.LevelMap
levels[errctx.ErrGroupBadNull] = errctx.LevelWarn
levels[errctx.ErrGroupNoDefault] = errctx.LevelWarn
sessVars.StmtCtx.SetErrLevels(levels)
>>>>>>> 91beef4bb14 (*: disable insert null to not-null column for single-row insertion in non-strict mode (#55477)):pkg/expression/builtin_miscellaneous_vec_test.go
input.AppendFloat64(0, 1)
err = f.vecEvalInt(input, result)
require.NoError(t, err)
Expand Down Expand Up @@ -184,7 +191,13 @@ func TestSleepVectorized(t *testing.T) {
require.Equal(t, uint16(warnCnt.add(2)), sessVars.StmtCtx.WarningCount())

// for error case under the strict model
<<<<<<< HEAD:expression/builtin_miscellaneous_vec_test.go
sessVars.StmtCtx.BadNullAsWarning = false
=======
levels[errctx.ErrGroupBadNull] = errctx.LevelError
levels[errctx.ErrGroupNoDefault] = errctx.LevelError
sessVars.StmtCtx.SetErrLevels(levels)
>>>>>>> 91beef4bb14 (*: disable insert null to not-null column for single-row insertion in non-strict mode (#55477)):pkg/expression/builtin_miscellaneous_vec_test.go
input.Reset()
input.AppendNull(0)
err = f.vecEvalInt(input, result)
Expand Down
13 changes: 13 additions & 0 deletions expression/evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ func TestSleep(t *testing.T) {

fc := funcs[ast.Sleep]
// non-strict model
<<<<<<< HEAD:expression/evaluator_test.go
sessVars.StmtCtx.BadNullAsWarning = true
=======
var levels errctx.LevelMap
levels[errctx.ErrGroupBadNull] = errctx.LevelWarn
levels[errctx.ErrGroupNoDefault] = errctx.LevelWarn
sessVars.StmtCtx.SetErrLevels(levels)
>>>>>>> 91beef4bb14 (*: disable insert null to not-null column for single-row insertion in non-strict mode (#55477)):pkg/expression/evaluator_test.go
d := make([]types.Datum, 1)
f, err := fc.getFunction(ctx, datumsToConstants(d))
require.NoError(t, err)
Expand All @@ -121,7 +128,13 @@ func TestSleep(t *testing.T) {
require.Equal(t, int64(0), ret)

// for error case under the strict model
<<<<<<< HEAD:expression/evaluator_test.go
sessVars.StmtCtx.BadNullAsWarning = false
=======
levels[errctx.ErrGroupBadNull] = errctx.LevelError
levels[errctx.ErrGroupNoDefault] = errctx.LevelError
sessVars.StmtCtx.SetErrLevels(levels)
>>>>>>> 91beef4bb14 (*: disable insert null to not-null column for single-row insertion in non-strict mode (#55477)):pkg/expression/evaluator_test.go
d[0].SetNull()
_, err = fc.getFunction(ctx, datumsToConstants(d))
require.NoError(t, err)
Expand Down
Loading

0 comments on commit 7667400

Please sign in to comment.