Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: fix wrong behavior in values function for Bit(1). #15350

Merged
merged 8 commits into from
Mar 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
wshwsh12 committed Mar 13, 2020
commit fa141724cc6771972d695d7ca745788866265cee
14 changes: 7 additions & 7 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5345,15 +5345,15 @@ func (s *testIntegrationSuite) TestValuesForBinaryLiteral(c *C) {
// See issue #15310
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test;")
tk.MustExec("create table t(id int primary key auto_increment, a bit(1));")
tk.MustExec("insert into t values(1,1);")
err := tk.ExecToErr("insert into t values(1,1) on duplicate key update id = values(id),a = values(a);")
tk.MustExec("create table testValuesBinary(id int primary key auto_increment, a bit(1));")
tk.MustExec("insert into testValuesBinary values(1,1);")
err := tk.ExecToErr("insert into testValuesBinary values(1,1) on duplicate key update id = values(id),a = values(a);")
c.Assert(err, IsNil)
tk.MustQuery("select a=0 from t;").Check(testkit.Rows("0"))
err = tk.ExecToErr("insert into t values(1,0) on duplicate key update id = values(id),a = values(a);")
tk.MustQuery("select a=0 from testValuesBinary;").Check(testkit.Rows("0"))
err = tk.ExecToErr("insert into testValuesBinary values(1,0) on duplicate key update id = values(id),a = values(a);")
c.Assert(err, IsNil)
tk.MustQuery("select a=0 from t;").Check(testkit.Rows("1"))
tk.MustExec("drop table t;")
tk.MustQuery("select a=0 from testValuesBinary;").Check(testkit.Rows("1"))
tk.MustExec("drop table testValuesBinary;")
}

func (s *testIntegrationSuite) TestIssue14159(c *C) {
Expand Down