MCPcopy
hub / github.com/pingcap/tidb / MustExec

Method MustExec

pkg/testkit/testkit.go:152–160  ·  view source on GitHub ↗

MustExec executes a sql statement and asserts nil error.

(sql string, args ...any)

Source from the content-addressed store, hash-verified

150
151// MustExec executes a sql statement and asserts nil error.
152func (tk *TestKit) MustExec(sql string, args ...any) {
153 defer func() {
154 if tk.alloc != nil {
155 tk.alloc.Reset()
156 }
157 }()
158 ctx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnOthers)
159 tk.MustExecWithContext(ctx, sql, args...)
160}
161
162// MustExecWithContext executes a sql statement and asserts nil error.
163func (tk *TestKit) MustExecWithContext(ctx context.Context, sql string, args ...any) {

Calls 2

MustExecWithContextMethod · 0.95
ResetMethod · 0.65