Skip to content

Commit

Permalink
ci: enhance test case for multi-pages result. (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun authored Apr 22, 2024
1 parent c1fb951 commit 26b258d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,23 @@ func (s *DatabendTestSuite) TestBasicSelect() {
s.r.Equal(int64(0), affected)
}

func (s *DatabendTestSuite) TestSelectMultiPage() {
// by default, each page size is 10000 rows
// So we need a large result set to test the multi pages case.
n := 46000
query := fmt.Sprintf("SELECT number from numbers(%d) order by number", n)
rows, err := s.db.Query(query)
s.r.Nil(err)

v := -1
for i := 0; i < n; i++ {
s.r.True(rows.Next())
rows.Scan(&v)
s.r.Equal(v, i)
}
s.r.False(rows.Next())
}

func (s *DatabendTestSuite) TestBatchInsert() {
r := require.New(s.T())

Expand Down

0 comments on commit 26b258d

Please sign in to comment.