package template

import (
	"database/sql"
	"testing"

	"github.com/pingcap/errors"
	. "github.com/pingcap/tidb-test/large_txn"
)

type MyPrepare struct {
	BasePrepareTask
}

// You can override the methods of the default one as you wish.
func (_ MyPrepare) CreateTable(db *sql.DB) error {
	sql1 := `create table if not exists sbtest1 (
id int(11) not null primary key,
k int(11) not null,
c char(120) not null default '',
pad char(255) not null default '')`
	_, err := db.Exec(sql1)
	if err != nil {
		return errors.WithStack(err)
	}
	return nil
}

// And run the test!
func TestT(t *testing.T) {
	conf := DefaultConfig()
	conf.Prepare.Task = &MyPrepare{}
	RunTest(&conf)
}
