Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei authored and ti-chi-bot committed Sep 25, 2021
1 parent bbd8706 commit 071042c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/multi_source/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ func addDropColumnDDL(ctx context.Context, db *sql.DB) {
}
}

// addDropColumnDDL2 tests the following scenario:
// 1. Create a table, executing DML of this table in background
// 2. alter table add column v1 varchar(20) default "xxx" not null
// 3. Some rows could have no data for column v1, however when we decode them,
// we could use the new table schema (which has the column of v1, caused by
// online DDL). Since the column data doesn't exist, the tidb library will
// fill in a default value, which is a string type. That's why we can get
// either []byte or a string of a column.Value
func addDropColumnDDL2(ctx context.Context, db *sql.DB) {
testName := getFunctionName(addDropColumnDDL2)
mustCreateTable(db, testName)
Expand Down

0 comments on commit 071042c

Please sign in to comment.