Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
fzzf678 committed Feb 14, 2023
1 parent 9715c6e commit add218d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
10 changes: 2 additions & 8 deletions infoschema/cluster_tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -854,14 +854,8 @@ func TestMDLView(t *testing.T) {
}

func TestCreateBindingForPrepareToken(t *testing.T) {
s := new(clusterTablesSuite)
s.store, s.dom = testkit.CreateMockStoreAndDomain(t)
s.rpcserver, s.listenAddr = s.setUpRPCService(t, "127.0.0.1:0", nil)
s.httpServer, s.mockAddr = s.setUpMockPDHTTPServer()
s.startTime = time.Now()
defer s.httpServer.Close()
defer s.rpcserver.Stop()
tk := s.newTestKitWithRoot(t)
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
require.NoError(t, tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil))

tk.MustExec("use test")
Expand Down
5 changes: 0 additions & 5 deletions util/stmtsummary/statement_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,10 @@ func getBindableStmtByPlanDigest(ssbd *stmtSummaryByDigest, planDigest string) *
}
// If it is SQL command prepare / execute, we should remove the arguments
// If it is binary protocol prepare / execute, ssbd.normalizedSQL should be same as ssElement.sampleSQL.
<<<<<<< HEAD
if ssElement.prepared {
stmt.Query = ssbd.normalizedSQL
=======
if row.GetInt64(4) == 1 {
if idx := strings.LastIndex(stmt.Query, "[arguments:"); idx != -1 {
stmt.Query = stmt.Query[:idx]
}
>>>>>>> 98fe813b49 (planner: fix space requirement when binding from history (#41140))
}
return stmt
}
Expand Down

0 comments on commit add218d

Please sign in to comment.