Skip to content

Commit

Permalink
table: add more error checking in tests (pingcap#8106)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngaut authored Oct 30, 2018
1 parent 696ef7b commit a7532f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions table/tables/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func (ts *testSuite) TestTableFromMeta(c *C) {
c.Assert(err, IsNil)
c.Assert(ts.se.NewTxn(), IsNil)
tb, err := ts.dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("meta"))
c.Assert(err, IsNil)
tbInfo := tb.Meta()
tbInfo.Columns[0].GeneratedExprString = "test"
tables.TableFromMeta(nil, tbInfo)
Expand Down Expand Up @@ -344,6 +345,7 @@ PARTITION BY RANGE ( id ) (
_, err = ts.se.Execute(context.Background(), createTable1)
c.Assert(err, IsNil)
tb, err := ts.dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("t1"))
c.Assert(err, IsNil)
tbInfo := tb.Meta()
p0 := tbInfo.Partition.Definitions[0]
c.Assert(p0.Name, Equals, model.NewCIStr("p0"))
Expand Down Expand Up @@ -391,6 +393,7 @@ PARTITION BY RANGE ( id ) (
c.Assert(err, IsNil)
c.Assert(ts.se.NewTxn(), IsNil)
tb, err = ts.dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("t2"))
c.Assert(err, IsNil)
tbInfo = tb.Meta()
_, err = tb.AddRecord(ts.se, types.MakeDatums(22), false)
c.Assert(err, IsNil) // Insert into maxvalue partition.
Expand All @@ -411,6 +414,7 @@ PARTITION BY RANGE ( id ) (
_, err = ts.se.Execute(context.Background(), createTable1)
c.Assert(err, IsNil)
tb, err := ts.dom.InfoSchema().TableByName(model.NewCIStr("test"), model.NewCIStr("t1"))
c.Assert(err, IsNil)
tbInfo := tb.Meta()
ps := tbInfo.GetPartitionInfo()
c.Assert(ps, NotNil)
Expand Down

0 comments on commit a7532f1

Please sign in to comment.