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

parser: support for flush status #7369

Merged
merged 5 commits into from
Aug 13, 2018
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
1 change: 1 addition & 0 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ const (
FlushNone FlushStmtType = iota
FlushTables
FlushPrivileges
FlushStatus
)

// FlushStmt is a statement to flush tables/privileges/optimizer costs and so on.
Expand Down
6 changes: 6 additions & 0 deletions parser/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -5518,6 +5518,12 @@ FlushOption:
Tp: ast.FlushPrivileges,
}
}
| "STATUS"
{
$$ = &ast.FlushStmt{
Tp: ast.FlushStatus,
}
}
| TableOrTables TableNameListOpt WithReadLockOpt
{
$$ = &ast.FlushStmt{
Expand Down
1 change: 1 addition & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ func (s *testParserSuite) TestDBAStmt(c *C) {
{"flush tables tbl1, tbl2, tbl3", true},
{"flush tables tbl1, tbl2, tbl3 with read lock", true},
{"flush privileges", true},
{"flush status", true},
}
s.RunTest(c, table)
}
Expand Down