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

Method MustExec

pkg/testkit/dbtestkit.go:68–74  ·  view source on GitHub ↗

MustExec query the statements and returns the result.

(sql string, args ...any)

Source from the content-addressed store, hash-verified

66
67// MustExec query the statements and returns the result.
68func (tk *DBTestKit) MustExec(sql string, args ...any) sql.Result {
69 comment := fmt.Sprintf("sql:%s, args:%v", sql, args)
70 rs, err := tk.db.Exec(sql, args...)
71 tk.require.NoError(err, comment)
72 tk.require.NotNil(rs, comment)
73 return rs
74}
75
76// MustQuery query the statements and returns result rows.
77func (tk *DBTestKit) MustQuery(sql string, args ...any) *sql.Rows {

Callers 15

loopExecMethod · 0.95
TestTopSQLCPUProfileFunction · 0.95
TestTopSQLStatementStatsFunction · 0.95
TestTopSQLResourceTagFunction · 0.95
TestRcReadCheckTSFunction · 0.95
TestDumpPlanReplayerAPIFunction · 0.95

Calls 2

NotNilMethod · 0.80
ExecMethod · 0.65

Tested by 15

TestTopSQLCPUProfileFunction · 0.76
TestTopSQLStatementStatsFunction · 0.76
TestTopSQLResourceTagFunction · 0.76
TestRcReadCheckTSFunction · 0.76
TestDumpPlanReplayerAPIFunction · 0.76
prepareData4PlanReplayerFunction · 0.76