Skip to content

Commit

Permalink
add UT of 24477
Browse files Browse the repository at this point in the history
  • Loading branch information
sylzd committed May 13, 2021
1 parent 54806f6 commit e2a5787
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util/ranger/ranger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1504,12 +1504,13 @@ func (s *testRangerSuite) TestIndexRangeForYear(c *C) {
// test index range
testKit.MustExec("DROP TABLE IF EXISTS t")
testKit.MustExec("CREATE TABLE t (a year(4), key(a))")
testKit.MustExec("INSERT INTO t VALUES (1), (70), (99), (0), ('0')")
testKit.MustExec("INSERT INTO t VALUES (1), (70), (99), (0), ('0'), (NULL)")
testKit.MustQuery("SELECT * FROM t WHERE a < 15698").Check(testkit.Rows("0", "1970", "1999", "2000", "2001"))
testKit.MustQuery("SELECT * FROM t WHERE a <= 0").Check(testkit.Rows("0"))
testKit.MustQuery("SELECT * FROM t WHERE a <= 1").Check(testkit.Rows("0", "1970", "1999", "2000", "2001"))
testKit.MustQuery("SELECT * FROM t WHERE a < 2000").Check(testkit.Rows("0", "1970", "1999"))
testKit.MustQuery("SELECT * FROM t WHERE a > -1").Check(testkit.Rows("0", "1970", "1999", "2000", "2001"))
testKit.MustQuery("SELECT * FROM t WHERE a <=> NULL").Check(testkit.Rows("<nil>"))

tests := []struct {
indexPos int
Expand Down

0 comments on commit e2a5787

Please sign in to comment.