Skip to content

Commit

Permalink
palnner: add unit test for ifnull args with signed and unsigned (#17652)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeryk committed Nov 16, 2020
1 parent efc9e9f commit ab1fafe
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions planner/core/expression_rewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,21 @@ func (s *testExpressionRewriterSuite) TestIssue9869(c *C) {
tk.MustQuery("select (case t1.a when 0 then 0 else t1.b end), cast(t1.b as signed) from t1;").Check(
testkit.Rows("4572794622775114594 4572794622775114594", "18196094287899841997 -250649785809709619", "11120436154190595086 -7326307919518956530"))
}

func (s *testExpressionRewriterSuite) TestIssue17652(c *C) {
defer testleak.AfterTest(c)()
store, dom, err := newStoreWithBootstrap()
c.Assert(err, IsNil)
tk := testkit.NewTestKit(c, store)
defer func() {
dom.Close()
store.Close()
}()

tk.MustExec("use test;")
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t(x bigint unsigned);")
tk.MustExec("insert into t values( 9999999703771440633);")
tk.MustQuery("select ifnull(max(x), 0) from t").Check(
testkit.Rows("9999999703771440633"))
}

0 comments on commit ab1fafe

Please sign in to comment.