Skip to content

Commit

Permalink
infoschema: make information_schema.columns copyable (pingcap#45552)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta authored Nov 23, 2023
1 parent 1cf2826 commit 0e8f8cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkg/ddl/tests/serial/serial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ func TestCreateTableWithLike(t *testing.T) {

tk.MustExec("drop database ctwl_db")
tk.MustExec("drop database ctwl_db1")

// Test information_schema.columns copiability.
// See https://github.com/pingcap/tidb/issues/42030.
tk.MustExec("use test")
tk.MustExec("create table cc like information_schema.columns;")
tk.MustExec("insert into cc select * from information_schema.columns;")
}

func TestCreateTableWithLikeAtTemporaryMode(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ var columnsCols = []columnInfo{
{name: "COLLATION_NAME", tp: mysql.TypeVarchar, size: 32},
{name: "COLUMN_TYPE", tp: mysql.TypeBlob, size: 196606},
{name: "COLUMN_KEY", tp: mysql.TypeVarchar, size: 3},
{name: "EXTRA", tp: mysql.TypeVarchar, size: 30},
{name: "EXTRA", tp: mysql.TypeVarchar, size: 45},
{name: "PRIVILEGES", tp: mysql.TypeVarchar, size: 80},
{name: "COLUMN_COMMENT", tp: mysql.TypeVarchar, size: 1024},
{name: "GENERATION_EXPRESSION", tp: mysql.TypeBlob, size: 589779, flag: mysql.NotNullFlag},
Expand Down

0 comments on commit 0e8f8cd

Please sign in to comment.