Skip to content

Commit

Permalink
ast: do statement is read only (pingcap#5752)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Jan 30, 2018
1 parent 7f8879d commit 86897e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ast/read_only_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func IsReadOnly(node Node) bool {

node.Accept(&checker)
return checker.readOnly
case *ExplainStmt:
case *ExplainStmt, *DoStmt:
return true
default:
return false
Expand Down
3 changes: 3 additions & 0 deletions ast/read_only_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ func (s *testCacheableSuite) TestCacheable(c *C) {

stmt = &ExplainStmt{}
c.Assert(IsReadOnly(stmt), IsTrue)

stmt = &DoStmt{}
c.Assert(IsReadOnly(stmt), IsTrue)
}

0 comments on commit 86897e0

Please sign in to comment.