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

*: Do retry when schema is expired #2094

Merged
merged 12 commits into from
Nov 28, 2016
Prev Previous commit
Next Next commit
*: update test
  • Loading branch information
zimulala committed Nov 26, 2016
commit 04328610c34da0e5ca12a2e3800fd691f6bacad2
4 changes: 2 additions & 2 deletions tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *testMainSuite) SetUpSuite(c *C) {
CREATE TABLE tbl_test1(id INT NOT NULL DEFAULT 2, name varchar(255), PRIMARY KEY(id), INDEX name(name));
CREATE TABLE tbl_test2(id INT NOT NULL DEFAULT 3, name varchar(255), PRIMARY KEY(id));`
s.selectSQL = `SELECT * from tbl_test;`
checkSchemaValidityRetryTimes = 3
checkSchemaValidityRetryTimes = 5
checkSchemaValiditySleepTime = 20 * time.Millisecond
runtime.GOMAXPROCS(runtime.NumCPU())
}
Expand Down Expand Up @@ -342,12 +342,12 @@ func (s *testMainSuite) TestSchemaValidity(c *C) {
c.Assert(err, IsNil)
c.Assert(ver, NotNil)
sessionctx.GetDomain(ctx).SchemaValidity.SetExpireInfo(false, ver.Ver)
sessionctx.GetDomain(ctx).SchemaValidity.MockReloadFailed.SetValue(false)
mustExecSQL(c, se, "insert t values (1);")
// Make sure insert to table t2 transaction executes.
startCh2 <- struct{}{}
err = <-endCh2
c.Assert(err, IsNil, Commentf("err:%v", err))
sessionctx.GetDomain(ctx).SchemaValidity.MockReloadFailed.SetValue(false)

err = se.Close()
c.Assert(err, IsNil)
Expand Down