Skip to content

Commit

Permalink
Merge pull request #190 from pingcap/zimuxia/bit-unit-test
Browse files Browse the repository at this point in the history
table: Add the bit unit test
  • Loading branch information
ngaut committed Sep 18, 2015
2 parents 529bafe + 3e14f60 commit 08b755a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions table/tables/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,23 @@ func (ts *testSuite) TestTypes(c *C) {
_, err = ts.se.Execute("insert test.t values (1, 2, 3, 4, '5', '6', '7', '10:10:10', null, 1.4)")
c.Assert(err, IsNil)
rs, err := ts.se.Execute("select * from test.t where c1 = 1")
c.Assert(err, IsNil)
row, err := rs[0].FirstRow()
c.Assert(err, IsNil)
c.Assert(row, NotNil)
_, err = ts.se.Execute("drop table test.t")
c.Assert(err, IsNil)

_, err = ts.se.Execute("CREATE TABLE test.t (c1 tinyint unsigned, c2 smallint unsigned, c3 int unsigned, c4 bigint unsigned, c5 double)")
_, err = ts.se.Execute("CREATE TABLE test.t (c1 tinyint unsigned, c2 smallint unsigned, c3 int unsigned, c4 bigint unsigned, c5 double, c6 bit)")
c.Assert(err, IsNil)
_, err = ts.se.Execute("insert test.t values (1, 2, 3, 4, 5)")
_, err = ts.se.Execute("insert test.t values (1, 2, 3, 4, 5, 6)")
c.Assert(err, IsNil)
rs, err = ts.se.Execute("select * from test.t where c1 = 1")
c.Assert(err, IsNil)
row, err = rs[0].FirstRow()
c.Assert(err, IsNil)
c.Assert(row, NotNil)
c.Assert(row[5], Equals, uint64(6))
_, err = ts.se.Execute("drop table test.t")
c.Assert(err, IsNil)
}
Expand Down

0 comments on commit 08b755a

Please sign in to comment.