From 071042cfe05459794c81549028677424372d9826 Mon Sep 17 00:00:00 2001 From: amyangfei Date: Mon, 13 Sep 2021 11:04:40 +0800 Subject: [PATCH] add comment --- tests/multi_source/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/multi_source/main.go b/tests/multi_source/main.go index 8d0e25a8468..e6208efa94c 100644 --- a/tests/multi_source/main.go +++ b/tests/multi_source/main.go @@ -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)