diff --git a/infoschema/tables.go b/infoschema/tables.go index 93fb6edfdd3d8..ce2afb4954f65 100644 --- a/infoschema/tables.go +++ b/infoschema/tables.go @@ -231,7 +231,7 @@ type columnInfo struct { func buildColumnInfo(col columnInfo) *model.ColumnInfo { mCharset := charset.CharsetBin mCollation := charset.CharsetBin - if col.tp == mysql.TypeVarchar || col.tp == mysql.TypeBlob { + if col.tp == mysql.TypeVarchar || col.tp == mysql.TypeBlob || col.tp == mysql.TypeLongBlob { mCharset = charset.CharsetUTF8MB4 mCollation = charset.CollationUTF8MB4 } @@ -690,7 +690,7 @@ var tableProcesslistCols = []columnInfo{ {name: "COMMAND", tp: mysql.TypeVarchar, size: 16, flag: mysql.NotNullFlag, deflt: ""}, {name: "TIME", tp: mysql.TypeLong, size: 7, flag: mysql.NotNullFlag, deflt: 0}, {name: "STATE", tp: mysql.TypeVarchar, size: 7}, - {name: "INFO", tp: mysql.TypeString, size: 512}, + {name: "INFO", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, {name: "MEM", tp: mysql.TypeLonglong, size: 21, flag: mysql.UnsignedFlag}, {name: "TxnStart", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, } @@ -861,7 +861,7 @@ var tableClusterLogCols = []columnInfo{ {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, {name: "LEVEL", tp: mysql.TypeVarchar, size: 8}, - {name: "MESSAGE", tp: mysql.TypeVarString, size: 1024}, + {name: "MESSAGE", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, } var tableClusterLoadCols = []columnInfo{ diff --git a/infoschema/tables_test.go b/infoschema/tables_test.go index ddb9ed08e6802..91f75be8425c7 100644 --- a/infoschema/tables_test.go +++ b/infoschema/tables_test.go @@ -301,10 +301,19 @@ func (s *testTableSuite) TestInfoschemaFieldValue(c *C) { " `COMMAND` varchar(16) NOT NULL DEFAULT '',\n" + " `TIME` int(7) NOT NULL DEFAULT 0,\n" + " `STATE` varchar(7) DEFAULT NULL,\n" + - " `INFO` binary(512) DEFAULT NULL,\n" + + " `INFO` longtext DEFAULT NULL,\n" + " `MEM` bigint(21) unsigned DEFAULT NULL,\n" + " `TxnStart` varchar(64) NOT NULL DEFAULT ''\n" + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) + tk.MustQuery("show create table information_schema.cluster_log").Check( + testkit.Rows("" + + "CLUSTER_LOG CREATE TABLE `CLUSTER_LOG` (\n" + + " `TIME` varchar(32) DEFAULT NULL,\n" + + " `TYPE` varchar(64) DEFAULT NULL,\n" + + " `INSTANCE` varchar(64) DEFAULT NULL,\n" + + " `LEVEL` varchar(8) DEFAULT NULL,\n" + + " `MESSAGE` longtext DEFAULT NULL\n" + + ") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin")) } func (s *testTableSuite) TestCharacterSetCollations(c *C) {