Skip to content

Commit

Permalink
privilege: add drop_priv check when truncate table (#9870)
Browse files Browse the repository at this point in the history
  • Loading branch information
winkyao authored and crazycs520 committed Mar 24, 2019
1 parent d5f0d2b commit 630671e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion planner/core/logical_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ func (s *testPlanSuite) TestVisitInfo(c *C) {
{
sql: "truncate table t",
ans: []visitInfo{
{mysql.DeletePriv, "test", "t", "", nil},
{mysql.DropPriv, "test", "t", "", nil},
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion planner/core/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ func (b *PlanBuilder) buildDDL(node ast.DDLNode) (Plan, error) {
}
case *ast.TruncateTableStmt:
b.visitInfo = append(b.visitInfo, visitInfo{
privilege: mysql.DeletePriv,
privilege: mysql.DropPriv,
db: v.Table.Schema.L,
table: v.Table.Name.L,
err: nil,
Expand Down

0 comments on commit 630671e

Please sign in to comment.