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: make sleep function response to the kill statement (#10959) #12159

Merged
merged 3 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
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
fix CI
  • Loading branch information
tiancaiamao committed Sep 11, 2019
commit cee9cad43b1a29c5cd4b19fb3154d5d3c2b8e2dc
1 change: 1 addition & 0 deletions expression/builtin_miscellaneous.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func (b *builtinSleepSig) evalInt(row chunk.Row) (int64, bool, error) {
finish = true
}
default:
fmt.Println("================")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

if atomic.CompareAndSwapUint32(&sessVars.Killed, 1, 0) {
return 1, false, nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (ts ConnTestSuite) TestConnExecutionTimeout(c *C) {
c.Assert(err, IsNil)

err = cc.handleQuery(context.Background(), "select * FROM testTable2 WHERE SLEEP(3);")
c.Assert(err, NotNil)
c.Assert(err, IsNil)

_, err = se.Execute(context.Background(), "set @@max_execution_time = 0;")
c.Assert(err, IsNil)
Expand All @@ -231,7 +231,7 @@ func (ts ConnTestSuite) TestConnExecutionTimeout(c *C) {
c.Assert(err, IsNil)

err = cc.handleQuery(context.Background(), "select /*+ MAX_EXECUTION_TIME(100)*/ * FROM testTable2 WHERE SLEEP(3);")
c.Assert(err, NotNil)
c.Assert(err, IsNil)

c.Assert(failpoint.Disable("github.com/pingcap/tidb/server/FakeClientConn"), IsNil)
}