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

ddl: migrate test-infra to testify for ddl.testSerialDBSuite #33343

Merged
merged 2 commits into from
Mar 23, 2022
Merged
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
4 changes: 2 additions & 2 deletions ddl/column_modify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func TestCancelDropColumn(t *testing.T) {
if testCase.needAddColumn {
tk.MustExec("alter table test_drop_column add column c3 int")
tk.MustExec("alter table test_drop_column add index idx_c3(c3)")
c3IdxID = testGetIndexID(t, tk.Session(), "test", "test_drop_column", "idx_c3")
c3IdxID = external.GetIndexID(t, tk, "test", "test_drop_column", "idx_c3")
}

err := tk.ExecToErr("alter table test_drop_column drop column c3")
Expand Down Expand Up @@ -607,7 +607,7 @@ func TestCancelDropColumns(t *testing.T) {
if testCase.needAddColumn {
tk.MustExec("alter table test_drop_column add column c3 int, add column c4 int")
tk.MustExec("alter table test_drop_column add index idx_c3(c3)")
c3IdxID = testGetIndexID(t, tk.Session(), "test", "test_drop_column", "idx_c3")
c3IdxID = external.GetIndexID(t, tk, "test", "test_drop_column", "idx_c3")
}
err := tk.ExecToErr("alter table test_drop_column drop column c3, drop column c4")
tbl := external.GetTableByName(t, tk, "test", "test_drop_column")
Expand Down
17 changes: 17 additions & 0 deletions ddl/db_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/parser/terror"
"github.com/pingcap/tidb/planner/core"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/sessionctx/stmtctx"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/tablecodec"
Expand Down Expand Up @@ -1227,6 +1228,22 @@ func TestBitDefaultValue(t *testing.T) {
);`)
}

func backgroundExec(s kv.Storage, sql string, done chan error) {
se, err := session.CreateSession4Test(s)
if err != nil {
done <- errors.Trace(err)
return
}
defer se.Close()
_, err = se.Execute(context.Background(), "use test")
if err != nil {
done <- errors.Trace(err)
return
}
_, err = se.Execute(context.Background(), sql)
done <- errors.Trace(err)
}

func getHistoryDDLJob(store kv.Storage, id int64) (*model.Job, error) {
var job *model.Job

Expand Down
Loading