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

*: disable insert null to not-null column for single-row insertion in non-strict mode | tidb-test=pr/2410 (#55477) #58046

Open
wants to merge 1 commit into
base: release-6.5
Choose a base branch
from
Open
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
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
Loading