Skip to content

Commit

Permalink
Updates per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael committed Oct 25, 2017
1 parent 27b0c90 commit fbd4a56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go/vt/schemamanager/tablet_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (exec *TabletExecutor) detectBigSchemaChanges(ctx context.Context, parsedDD
}
for _, ddl := range parsedDDLs {
switch ddl.Action {
case sqlparser.DropStr, sqlparser.CreateStr:
case sqlparser.DropStr, sqlparser.CreateStr, sqlparser.TruncateStr:
continue
}
tableName := ddl.Table.Name.String()
Expand Down
6 changes: 6 additions & 0 deletions go/vt/schemamanager/tablet_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ func TestTabletExecutorValidate(t *testing.T) {
t.Fatalf("executor.Validate should fail, change a table more than 2,000,000 rows")
}

if err := executor.Validate(ctx, []string{
"TRUNCATE TABLE test_table_04",
}); err != nil {
t.Fatalf("executor.Validate should succeed, drop a table with more than 2,000,000 rows is allowed")
}

if err := executor.Validate(ctx, []string{
"DROP TABLE test_table_04",
}); err != nil {
Expand Down

0 comments on commit fbd4a56

Please sign in to comment.