diff --git a/infoschema/cluster.go b/infoschema/cluster.go index 8b4da69d1b88b..2bb5505ed76e6 100644 --- a/infoschema/cluster.go +++ b/infoschema/cluster.go @@ -40,7 +40,7 @@ var memTableToClusterTables = map[string]string{ } func init() { - var addrCol = columnInfo{"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil} + var addrCol = columnInfo{name: "INSTANCE", tp: mysql.TypeVarchar, size: 64} for memTableName, clusterMemTableName := range memTableToClusterTables { memTableCols := tableNameToColumns[memTableName] if len(memTableCols) == 0 { diff --git a/infoschema/metrics_schema.go b/infoschema/metrics_schema.go index 3411cc3373a71..49a57e4ac9eeb 100644 --- a/infoschema/metrics_schema.go +++ b/infoschema/metrics_schema.go @@ -84,16 +84,16 @@ func GetMetricTableDef(lowerTableName string) (*MetricTableDef, error) { func (def *MetricTableDef) genColumnInfos() []columnInfo { cols := []columnInfo{ - {"time", mysql.TypeDatetime, 19, 0, "CURRENT_TIMESTAMP", nil}, + {name: "time", tp: mysql.TypeDatetime, size: 19, deflt: "CURRENT_TIMESTAMP"}, } for _, label := range def.Labels { - cols = append(cols, columnInfo{label, mysql.TypeVarchar, 512, 0, nil, nil}) + cols = append(cols, columnInfo{name: label, tp: mysql.TypeVarchar, size: 512}) } if def.Quantile > 0 { defaultValue := strconv.FormatFloat(def.Quantile, 'f', -1, 64) - cols = append(cols, columnInfo{"quantile", mysql.TypeDouble, 22, 0, defaultValue, nil}) + cols = append(cols, columnInfo{name: "quantile", tp: mysql.TypeDouble, size: 22, deflt: defaultValue}) } - cols = append(cols, columnInfo{"value", mysql.TypeDouble, 22, 0, nil, nil}) + cols = append(cols, columnInfo{name: "value", tp: mysql.TypeDouble, size: 22}) return cols } diff --git a/infoschema/tables.go b/infoschema/tables.go index 4ed5e213a4aff..66c585e25902f 100755 --- a/infoschema/tables.go +++ b/infoschema/tables.go @@ -181,12 +181,12 @@ var tableIDMap = map[string]int64{ } type columnInfo struct { - name string - tp byte - size int - flag uint - deflt interface{} - elems []string + name string + tp byte + size int + decimal int + flag uint + deflt interface{} } func buildColumnInfo(tableName string, col columnInfo) *model.ColumnInfo { @@ -203,6 +203,7 @@ func buildColumnInfo(tableName string, col columnInfo) *model.ColumnInfo { Collate: mCollation, Tp: col.tp, Flen: col.size, + Decimal: col.decimal, Flag: mFlag, } return &model.ColumnInfo{ @@ -230,616 +231,729 @@ func buildTableMeta(tableName string, cs []columnInfo) *model.TableInfo { } var schemataCols = []columnInfo{ - {"CATALOG_NAME", mysql.TypeVarchar, 512, 0, nil, nil}, - {"SCHEMA_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEFAULT_CHARACTER_SET_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEFAULT_COLLATION_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"SQL_PATH", mysql.TypeVarchar, 512, 0, nil, nil}, + {name: "CATALOG_NAME", tp: mysql.TypeVarchar, size: 512}, + {name: "SCHEMA_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "DEFAULT_CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "DEFAULT_COLLATION_NAME", tp: mysql.TypeVarchar, size: 32}, + {name: "SQL_PATH", tp: mysql.TypeVarchar, size: 512}, } var tablesCols = []columnInfo{ - {"TABLE_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ENGINE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"VERSION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"ROW_FORMAT", mysql.TypeVarchar, 10, 0, nil, nil}, - {"TABLE_ROWS", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AVG_ROW_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"MAX_DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_FREE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AUTO_INCREMENT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CREATE_TIME", mysql.TypeDatetime, 19, 0, nil, nil}, - {"UPDATE_TIME", mysql.TypeDatetime, 19, 0, nil, nil}, - {"CHECK_TIME", mysql.TypeDatetime, 19, 0, nil, nil}, - {"TABLE_COLLATION", mysql.TypeVarchar, 32, mysql.NotNullFlag, "utf8_bin", nil}, - {"CHECKSUM", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CREATE_OPTIONS", mysql.TypeVarchar, 255, 0, nil, nil}, - {"TABLE_COMMENT", mysql.TypeVarchar, 2048, 0, nil, nil}, - {"TIDB_TABLE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"TIDB_ROW_ID_SHARDING_INFO", mysql.TypeVarchar, 255, 0, nil, nil}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "ENGINE", tp: mysql.TypeVarchar, size: 64}, + {name: "VERSION", tp: mysql.TypeLonglong, size: 21}, + {name: "ROW_FORMAT", tp: mysql.TypeVarchar, size: 10}, + {name: "TABLE_ROWS", tp: mysql.TypeLonglong, size: 21}, + {name: "AVG_ROW_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "MAX_DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_FREE", tp: mysql.TypeLonglong, size: 21}, + {name: "AUTO_INCREMENT", tp: mysql.TypeLonglong, size: 21}, + {name: "CREATE_TIME", tp: mysql.TypeDatetime, size: 19}, + {name: "UPDATE_TIME", tp: mysql.TypeDatetime, size: 19}, + {name: "CHECK_TIME", tp: mysql.TypeDatetime, size: 19}, + {name: "TABLE_COLLATION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag, deflt: "utf8_bin"}, + {name: "CHECKSUM", tp: mysql.TypeLonglong, size: 21}, + {name: "CREATE_OPTIONS", tp: mysql.TypeVarchar, size: 255}, + {name: "TABLE_COMMENT", tp: mysql.TypeVarchar, size: 2048}, + {name: "TIDB_TABLE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "TIDB_ROW_ID_SHARDING_INFO", tp: mysql.TypeVarchar, size: 255}, } // See: http://dev.mysql.com/doc/refman/5.7/en/columns-table.html var columnsCols = []columnInfo{ - {"TABLE_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ORDINAL_POSITION", mysql.TypeLonglong, 64, 0, nil, nil}, - {"COLUMN_DEFAULT", mysql.TypeBlob, 196606, 0, nil, nil}, - {"IS_NULLABLE", mysql.TypeVarchar, 3, 0, nil, nil}, - {"DATA_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"CHARACTER_MAXIMUM_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CHARACTER_OCTET_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"NUMERIC_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"NUMERIC_SCALE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATETIME_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"COLLATION_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"COLUMN_TYPE", mysql.TypeBlob, 196606, 0, nil, nil}, - {"COLUMN_KEY", mysql.TypeVarchar, 3, 0, nil, nil}, - {"EXTRA", mysql.TypeVarchar, 30, 0, nil, nil}, - {"PRIVILEGES", mysql.TypeVarchar, 80, 0, nil, nil}, - {"COLUMN_COMMENT", mysql.TypeVarchar, 1024, 0, nil, nil}, - {"GENERATION_EXPRESSION", mysql.TypeBlob, 589779, mysql.NotNullFlag, nil, nil}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "ORDINAL_POSITION", tp: mysql.TypeLonglong, size: 64}, + {name: "COLUMN_DEFAULT", tp: mysql.TypeBlob, size: 196606}, + {name: "IS_NULLABLE", tp: mysql.TypeVarchar, size: 3}, + {name: "DATA_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "CHARACTER_MAXIMUM_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "CHARACTER_OCTET_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "NUMERIC_PRECISION", tp: mysql.TypeLonglong, size: 21}, + {name: "NUMERIC_SCALE", tp: mysql.TypeLonglong, size: 21}, + {name: "DATETIME_PRECISION", tp: mysql.TypeLonglong, size: 21}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 32}, + {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: "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}, } var columnStatisticsCols = []columnInfo{ - {"SCHEMA_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"HISTOGRAM", mysql.TypeJSON, 51, 0, nil, nil}, + {name: "SCHEMA_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "HISTOGRAM", tp: mysql.TypeJSON, size: 51}, } var statisticsCols = []columnInfo{ - {"TABLE_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"NON_UNIQUE", mysql.TypeVarchar, 1, 0, nil, nil}, - {"INDEX_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INDEX_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SEQ_IN_INDEX", mysql.TypeLonglong, 2, 0, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 21, 0, nil, nil}, - {"COLLATION", mysql.TypeVarchar, 1, 0, nil, nil}, - {"CARDINALITY", mysql.TypeLonglong, 21, 0, nil, nil}, - {"SUB_PART", mysql.TypeLonglong, 3, 0, nil, nil}, - {"PACKED", mysql.TypeVarchar, 10, 0, nil, nil}, - {"NULLABLE", mysql.TypeVarchar, 3, 0, nil, nil}, - {"INDEX_TYPE", mysql.TypeVarchar, 16, 0, nil, nil}, - {"COMMENT", mysql.TypeVarchar, 16, 0, nil, nil}, - {"Expression", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INDEX_COMMENT", mysql.TypeVarchar, 1024, 0, nil, nil}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "NON_UNIQUE", tp: mysql.TypeVarchar, size: 1}, + {name: "INDEX_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "INDEX_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "SEQ_IN_INDEX", tp: mysql.TypeLonglong, size: 2}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 21}, + {name: "COLLATION", tp: mysql.TypeVarchar, size: 1}, + {name: "CARDINALITY", tp: mysql.TypeLonglong, size: 21}, + {name: "SUB_PART", tp: mysql.TypeLonglong, size: 3}, + {name: "PACKED", tp: mysql.TypeVarchar, size: 10}, + {name: "NULLABLE", tp: mysql.TypeVarchar, size: 3}, + {name: "INDEX_TYPE", tp: mysql.TypeVarchar, size: 16}, + {name: "COMMENT", tp: mysql.TypeVarchar, size: 16}, + {name: "Expression", tp: mysql.TypeVarchar, size: 64}, + {name: "INDEX_COMMENT", tp: mysql.TypeVarchar, size: 1024}, } var profilingCols = []columnInfo{ - {"QUERY_ID", mysql.TypeLong, 20, 0, nil, nil}, - {"SEQ", mysql.TypeLong, 20, 0, nil, nil}, - {"STATE", mysql.TypeVarchar, 30, 0, nil, nil}, - {"DURATION", mysql.TypeNewDecimal, 9, 0, nil, nil}, - {"CPU_USER", mysql.TypeNewDecimal, 9, 0, nil, nil}, - {"CPU_SYSTEM", mysql.TypeNewDecimal, 9, 0, nil, nil}, - {"CONTEXT_VOLUNTARY", mysql.TypeLong, 20, 0, nil, nil}, - {"CONTEXT_INVOLUNTARY", mysql.TypeLong, 20, 0, nil, nil}, - {"BLOCK_OPS_IN", mysql.TypeLong, 20, 0, nil, nil}, - {"BLOCK_OPS_OUT", mysql.TypeLong, 20, 0, nil, nil}, - {"MESSAGES_SENT", mysql.TypeLong, 20, 0, nil, nil}, - {"MESSAGES_RECEIVED", mysql.TypeLong, 20, 0, nil, nil}, - {"PAGE_FAULTS_MAJOR", mysql.TypeLong, 20, 0, nil, nil}, - {"PAGE_FAULTS_MINOR", mysql.TypeLong, 20, 0, nil, nil}, - {"SWAPS", mysql.TypeLong, 20, 0, nil, nil}, - {"SOURCE_FUNCTION", mysql.TypeVarchar, 30, 0, nil, nil}, - {"SOURCE_FILE", mysql.TypeVarchar, 20, 0, nil, nil}, - {"SOURCE_LINE", mysql.TypeLong, 20, 0, nil, nil}, + {name: "QUERY_ID", tp: mysql.TypeLong, size: 20}, + {name: "SEQ", tp: mysql.TypeLong, size: 20}, + {name: "STATE", tp: mysql.TypeVarchar, size: 30}, + {name: "DURATION", tp: mysql.TypeNewDecimal, size: 9}, + {name: "CPU_USER", tp: mysql.TypeNewDecimal, size: 9}, + {name: "CPU_SYSTEM", tp: mysql.TypeNewDecimal, size: 9}, + {name: "CONTEXT_VOLUNTARY", tp: mysql.TypeLong, size: 20}, + {name: "CONTEXT_INVOLUNTARY", tp: mysql.TypeLong, size: 20}, + {name: "BLOCK_OPS_IN", tp: mysql.TypeLong, size: 20}, + {name: "BLOCK_OPS_OUT", tp: mysql.TypeLong, size: 20}, + {name: "MESSAGES_SENT", tp: mysql.TypeLong, size: 20}, + {name: "MESSAGES_RECEIVED", tp: mysql.TypeLong, size: 20}, + {name: "PAGE_FAULTS_MAJOR", tp: mysql.TypeLong, size: 20}, + {name: "PAGE_FAULTS_MINOR", tp: mysql.TypeLong, size: 20}, + {name: "SWAPS", tp: mysql.TypeLong, size: 20}, + {name: "SOURCE_FUNCTION", tp: mysql.TypeVarchar, size: 30}, + {name: "SOURCE_FILE", tp: mysql.TypeVarchar, size: 20}, + {name: "SOURCE_LINE", tp: mysql.TypeLong, size: 20}, } var charsetCols = []columnInfo{ - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"DEFAULT_COLLATE_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"DESCRIPTION", mysql.TypeVarchar, 60, 0, nil, nil}, - {"MAXLEN", mysql.TypeLonglong, 3, 0, nil, nil}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 32}, + {name: "DEFAULT_COLLATE_NAME", tp: mysql.TypeVarchar, size: 32}, + {name: "DESCRIPTION", tp: mysql.TypeVarchar, size: 60}, + {name: "MAXLEN", tp: mysql.TypeLonglong, size: 3}, } var collationsCols = []columnInfo{ - {"COLLATION_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"ID", mysql.TypeLonglong, 11, 0, nil, nil}, - {"IS_DEFAULT", mysql.TypeVarchar, 3, 0, nil, nil}, - {"IS_COMPILED", mysql.TypeVarchar, 3, 0, nil, nil}, - {"SORTLEN", mysql.TypeLonglong, 3, 0, nil, nil}, + {name: "COLLATION_NAME", tp: mysql.TypeVarchar, size: 32}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 32}, + {name: "ID", tp: mysql.TypeLonglong, size: 11}, + {name: "IS_DEFAULT", tp: mysql.TypeVarchar, size: 3}, + {name: "IS_COMPILED", tp: mysql.TypeVarchar, size: 3}, + {name: "SORTLEN", tp: mysql.TypeLonglong, size: 3}, } var keyColumnUsageCols = []columnInfo{ - {"CONSTRAINT_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"CONSTRAINT_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"CONSTRAINT_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ORDINAL_POSITION", mysql.TypeLonglong, 10, mysql.NotNullFlag, nil, nil}, - {"POSITION_IN_UNIQUE_CONSTRAINT", mysql.TypeLonglong, 10, 0, nil, nil}, - {"REFERENCED_TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"REFERENCED_TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"REFERENCED_COLUMN_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "CONSTRAINT_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "CONSTRAINT_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "CONSTRAINT_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ORDINAL_POSITION", tp: mysql.TypeLonglong, size: 10, flag: mysql.NotNullFlag}, + {name: "POSITION_IN_UNIQUE_CONSTRAINT", tp: mysql.TypeLonglong, size: 10}, + {name: "REFERENCED_TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "REFERENCED_TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "REFERENCED_COLUMN_NAME", tp: mysql.TypeVarchar, size: 64}, } // See http://dev.mysql.com/doc/refman/5.7/en/referential-constraints-table.html var referConstCols = []columnInfo{ - {"CONSTRAINT_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"CONSTRAINT_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"CONSTRAINT_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"UNIQUE_CONSTRAINT_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"UNIQUE_CONSTRAINT_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"UNIQUE_CONSTRAINT_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"MATCH_OPTION", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"UPDATE_RULE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"DELETE_RULE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"REFERENCED_TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, + {name: "CONSTRAINT_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "CONSTRAINT_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "CONSTRAINT_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "UNIQUE_CONSTRAINT_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "UNIQUE_CONSTRAINT_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "UNIQUE_CONSTRAINT_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "MATCH_OPTION", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "UPDATE_RULE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "DELETE_RULE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "REFERENCED_TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, } // See http://dev.mysql.com/doc/refman/5.7/en/variables-table.html var sessionVarCols = []columnInfo{ - {"VARIABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"VARIABLE_VALUE", mysql.TypeVarchar, 1024, 0, nil, nil}, + {name: "VARIABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "VARIABLE_VALUE", tp: mysql.TypeVarchar, size: 1024}, } // See https://dev.mysql.com/doc/refman/5.7/en/plugins-table.html var pluginsCols = []columnInfo{ - {"PLUGIN_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PLUGIN_VERSION", mysql.TypeVarchar, 20, 0, nil, nil}, - {"PLUGIN_STATUS", mysql.TypeVarchar, 10, 0, nil, nil}, - {"PLUGIN_TYPE", mysql.TypeVarchar, 80, 0, nil, nil}, - {"PLUGIN_TYPE_VERSION", mysql.TypeVarchar, 20, 0, nil, nil}, - {"PLUGIN_LIBRARY", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PLUGIN_LIBRARY_VERSION", mysql.TypeVarchar, 20, 0, nil, nil}, - {"PLUGIN_AUTHOR", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PLUGIN_DESCRIPTION", mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {"PLUGIN_LICENSE", mysql.TypeVarchar, 80, 0, nil, nil}, - {"LOAD_OPTION", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "PLUGIN_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "PLUGIN_VERSION", tp: mysql.TypeVarchar, size: 20}, + {name: "PLUGIN_STATUS", tp: mysql.TypeVarchar, size: 10}, + {name: "PLUGIN_TYPE", tp: mysql.TypeVarchar, size: 80}, + {name: "PLUGIN_TYPE_VERSION", tp: mysql.TypeVarchar, size: 20}, + {name: "PLUGIN_LIBRARY", tp: mysql.TypeVarchar, size: 64}, + {name: "PLUGIN_LIBRARY_VERSION", tp: mysql.TypeVarchar, size: 20}, + {name: "PLUGIN_AUTHOR", tp: mysql.TypeVarchar, size: 64}, + {name: "PLUGIN_DESCRIPTION", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: "PLUGIN_LICENSE", tp: mysql.TypeVarchar, size: 80}, + {name: "LOAD_OPTION", tp: mysql.TypeVarchar, size: 64}, } // See https://dev.mysql.com/doc/refman/5.7/en/partitions-table.html var partitionsCols = []columnInfo{ - {"TABLE_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PARTITION_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SUBPARTITION_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PARTITION_ORDINAL_POSITION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"SUBPARTITION_ORDINAL_POSITION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"PARTITION_METHOD", mysql.TypeVarchar, 18, 0, nil, nil}, - {"SUBPARTITION_METHOD", mysql.TypeVarchar, 12, 0, nil, nil}, - {"PARTITION_EXPRESSION", mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {"SUBPARTITION_EXPRESSION", mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {"PARTITION_DESCRIPTION", mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {"TABLE_ROWS", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AVG_ROW_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"MAX_DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_FREE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CREATE_TIME", mysql.TypeDatetime, 0, 0, nil, nil}, - {"UPDATE_TIME", mysql.TypeDatetime, 0, 0, nil, nil}, - {"CHECK_TIME", mysql.TypeDatetime, 0, 0, nil, nil}, - {"CHECKSUM", mysql.TypeLonglong, 21, 0, nil, nil}, - {"PARTITION_COMMENT", mysql.TypeVarchar, 80, 0, nil, nil}, - {"NODEGROUP", mysql.TypeVarchar, 12, 0, nil, nil}, - {"TABLESPACE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "PARTITION_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "SUBPARTITION_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "PARTITION_ORDINAL_POSITION", tp: mysql.TypeLonglong, size: 21}, + {name: "SUBPARTITION_ORDINAL_POSITION", tp: mysql.TypeLonglong, size: 21}, + {name: "PARTITION_METHOD", tp: mysql.TypeVarchar, size: 18}, + {name: "SUBPARTITION_METHOD", tp: mysql.TypeVarchar, size: 12}, + {name: "PARTITION_EXPRESSION", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: "SUBPARTITION_EXPRESSION", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: "PARTITION_DESCRIPTION", tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: "TABLE_ROWS", tp: mysql.TypeLonglong, size: 21}, + {name: "AVG_ROW_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "MAX_DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_FREE", tp: mysql.TypeLonglong, size: 21}, + {name: "CREATE_TIME", tp: mysql.TypeDatetime}, + {name: "UPDATE_TIME", tp: mysql.TypeDatetime}, + {name: "CHECK_TIME", tp: mysql.TypeDatetime}, + {name: "CHECKSUM", tp: mysql.TypeLonglong, size: 21}, + {name: "PARTITION_COMMENT", tp: mysql.TypeVarchar, size: 80}, + {name: "NODEGROUP", tp: mysql.TypeVarchar, size: 12}, + {name: "TABLESPACE_NAME", tp: mysql.TypeVarchar, size: 64}, } var tableConstraintsCols = []columnInfo{ - {"CONSTRAINT_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"CONSTRAINT_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"CONSTRAINT_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"CONSTRAINT_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "CONSTRAINT_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "CONSTRAINT_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "CONSTRAINT_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "CONSTRAINT_TYPE", tp: mysql.TypeVarchar, size: 64}, } var tableTriggersCols = []columnInfo{ - {"TRIGGER_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"TRIGGER_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TRIGGER_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"EVENT_MANIPULATION", mysql.TypeVarchar, 6, 0, nil, nil}, - {"EVENT_OBJECT_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"EVENT_OBJECT_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"EVENT_OBJECT_TABLE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ACTION_ORDER", mysql.TypeLonglong, 4, 0, nil, nil}, - {"ACTION_CONDITION", mysql.TypeBlob, -1, 0, nil, nil}, - {"ACTION_STATEMENT", mysql.TypeBlob, -1, 0, nil, nil}, - {"ACTION_ORIENTATION", mysql.TypeVarchar, 9, 0, nil, nil}, - {"ACTION_TIMING", mysql.TypeVarchar, 6, 0, nil, nil}, - {"ACTION_REFERENCE_OLD_TABLE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ACTION_REFERENCE_NEW_TABLE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ACTION_REFERENCE_OLD_ROW", mysql.TypeVarchar, 3, 0, nil, nil}, - {"ACTION_REFERENCE_NEW_ROW", mysql.TypeVarchar, 3, 0, nil, nil}, - {"CREATED", mysql.TypeDatetime, 2, 0, nil, nil}, - {"SQL_MODE", mysql.TypeVarchar, 8192, 0, nil, nil}, - {"DEFINER", mysql.TypeVarchar, 77, 0, nil, nil}, - {"CHARACTER_SET_CLIENT", mysql.TypeVarchar, 32, 0, nil, nil}, - {"COLLATION_CONNECTION", mysql.TypeVarchar, 32, 0, nil, nil}, - {"DATABASE_COLLATION", mysql.TypeVarchar, 32, 0, nil, nil}, + {name: "TRIGGER_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "TRIGGER_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TRIGGER_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "EVENT_MANIPULATION", tp: mysql.TypeVarchar, size: 6}, + {name: "EVENT_OBJECT_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "EVENT_OBJECT_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "EVENT_OBJECT_TABLE", tp: mysql.TypeVarchar, size: 64}, + {name: "ACTION_ORDER", tp: mysql.TypeLonglong, size: 4}, + {name: "ACTION_CONDITION", tp: mysql.TypeBlob, size: -1}, + {name: "ACTION_STATEMENT", tp: mysql.TypeBlob, size: -1}, + {name: "ACTION_ORIENTATION", tp: mysql.TypeVarchar, size: 9}, + {name: "ACTION_TIMING", tp: mysql.TypeVarchar, size: 6}, + {name: "ACTION_REFERENCE_OLD_TABLE", tp: mysql.TypeVarchar, size: 64}, + {name: "ACTION_REFERENCE_NEW_TABLE", tp: mysql.TypeVarchar, size: 64}, + {name: "ACTION_REFERENCE_OLD_ROW", tp: mysql.TypeVarchar, size: 3}, + {name: "ACTION_REFERENCE_NEW_ROW", tp: mysql.TypeVarchar, size: 3}, + {name: "CREATED", tp: mysql.TypeDatetime, size: 2}, + {name: "SQL_MODE", tp: mysql.TypeVarchar, size: 8192}, + {name: "DEFINER", tp: mysql.TypeVarchar, size: 77}, + {name: "CHARACTER_SET_CLIENT", tp: mysql.TypeVarchar, size: 32}, + {name: "COLLATION_CONNECTION", tp: mysql.TypeVarchar, size: 32}, + {name: "DATABASE_COLLATION", tp: mysql.TypeVarchar, size: 32}, } var tableUserPrivilegesCols = []columnInfo{ - {"GRANTEE", mysql.TypeVarchar, 81, 0, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 512, 0, nil, nil}, - {"PRIVILEGE_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"IS_GRANTABLE", mysql.TypeVarchar, 3, 0, nil, nil}, + {name: "GRANTEE", tp: mysql.TypeVarchar, size: 81}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512}, + {name: "PRIVILEGE_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "IS_GRANTABLE", tp: mysql.TypeVarchar, size: 3}, } var tableSchemaPrivilegesCols = []columnInfo{ - {"GRANTEE", mysql.TypeVarchar, 81, mysql.NotNullFlag, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"PRIVILEGE_TYPE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"IS_GRANTABLE", mysql.TypeVarchar, 3, mysql.NotNullFlag, nil, nil}, + {name: "GRANTEE", tp: mysql.TypeVarchar, size: 81, flag: mysql.NotNullFlag}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "PRIVILEGE_TYPE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "IS_GRANTABLE", tp: mysql.TypeVarchar, size: 3, flag: mysql.NotNullFlag}, } var tableTablePrivilegesCols = []columnInfo{ - {"GRANTEE", mysql.TypeVarchar, 81, mysql.NotNullFlag, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"PRIVILEGE_TYPE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"IS_GRANTABLE", mysql.TypeVarchar, 3, mysql.NotNullFlag, nil, nil}, + {name: "GRANTEE", tp: mysql.TypeVarchar, size: 81, flag: mysql.NotNullFlag}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "PRIVILEGE_TYPE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "IS_GRANTABLE", tp: mysql.TypeVarchar, size: 3, flag: mysql.NotNullFlag}, } var tableColumnPrivilegesCols = []columnInfo{ - {"GRANTEE", mysql.TypeVarchar, 81, mysql.NotNullFlag, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"PRIVILEGE_TYPE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"IS_GRANTABLE", mysql.TypeVarchar, 3, mysql.NotNullFlag, nil, nil}, + {name: "GRANTEE", tp: mysql.TypeVarchar, size: 81, flag: mysql.NotNullFlag}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "PRIVILEGE_TYPE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "IS_GRANTABLE", tp: mysql.TypeVarchar, size: 3, flag: mysql.NotNullFlag}, } var tableEnginesCols = []columnInfo{ - {"ENGINE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SUPPORT", mysql.TypeVarchar, 8, 0, nil, nil}, - {"COMMENT", mysql.TypeVarchar, 80, 0, nil, nil}, - {"TRANSACTIONS", mysql.TypeVarchar, 3, 0, nil, nil}, - {"XA", mysql.TypeVarchar, 3, 0, nil, nil}, - {"SAVEPOINTS", mysql.TypeVarchar, 3, 0, nil, nil}, + {name: "ENGINE", tp: mysql.TypeVarchar, size: 64}, + {name: "SUPPORT", tp: mysql.TypeVarchar, size: 8}, + {name: "COMMENT", tp: mysql.TypeVarchar, size: 80}, + {name: "TRANSACTIONS", tp: mysql.TypeVarchar, size: 3}, + {name: "XA", tp: mysql.TypeVarchar, size: 3}, + {name: "SAVEPOINTS", tp: mysql.TypeVarchar, size: 3}, } var tableViewsCols = []columnInfo{ - {"TABLE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"VIEW_DEFINITION", mysql.TypeLongBlob, 0, mysql.NotNullFlag, nil, nil}, - {"CHECK_OPTION", mysql.TypeVarchar, 8, mysql.NotNullFlag, nil, nil}, - {"IS_UPDATABLE", mysql.TypeVarchar, 3, mysql.NotNullFlag, nil, nil}, - {"DEFINER", mysql.TypeVarchar, 77, mysql.NotNullFlag, nil, nil}, - {"SECURITY_TYPE", mysql.TypeVarchar, 7, mysql.NotNullFlag, nil, nil}, - {"CHARACTER_SET_CLIENT", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"COLLATION_CONNECTION", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "VIEW_DEFINITION", tp: mysql.TypeLongBlob, flag: mysql.NotNullFlag}, + {name: "CHECK_OPTION", tp: mysql.TypeVarchar, size: 8, flag: mysql.NotNullFlag}, + {name: "IS_UPDATABLE", tp: mysql.TypeVarchar, size: 3, flag: mysql.NotNullFlag}, + {name: "DEFINER", tp: mysql.TypeVarchar, size: 77, flag: mysql.NotNullFlag}, + {name: "SECURITY_TYPE", tp: mysql.TypeVarchar, size: 7, flag: mysql.NotNullFlag}, + {name: "CHARACTER_SET_CLIENT", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "COLLATION_CONNECTION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, } var tableRoutinesCols = []columnInfo{ - {"SPECIFIC_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_TYPE", mysql.TypeVarchar, 9, mysql.NotNullFlag, nil, nil}, - {"DATA_TYPE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"CHARACTER_MAXIMUM_LENGTH", mysql.TypeLong, 21, 0, nil, nil}, - {"CHARACTER_OCTET_LENGTH", mysql.TypeLong, 21, 0, nil, nil}, - {"NUMERIC_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"NUMERIC_SCALE", mysql.TypeLong, 21, 0, nil, nil}, - {"DATETIME_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"COLLATION_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DTD_IDENTIFIER", mysql.TypeLongBlob, 0, 0, nil, nil}, - {"ROUTINE_BODY", mysql.TypeVarchar, 8, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_DEFINITION", mysql.TypeLongBlob, 0, 0, nil, nil}, - {"EXTERNAL_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"EXTERNAL_LANGUAGE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PARAMETER_STYLE", mysql.TypeVarchar, 8, mysql.NotNullFlag, nil, nil}, - {"IS_DETERMINISTIC", mysql.TypeVarchar, 3, mysql.NotNullFlag, nil, nil}, - {"SQL_DATA_ACCESS", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"SQL_PATH", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SECURITY_TYPE", mysql.TypeVarchar, 7, mysql.NotNullFlag, nil, nil}, - {"CREATED", mysql.TypeDatetime, 0, mysql.NotNullFlag, "0000-00-00 00:00:00", nil}, - {"LAST_ALTERED", mysql.TypeDatetime, 0, mysql.NotNullFlag, "0000-00-00 00:00:00", nil}, - {"SQL_MODE", mysql.TypeVarchar, 8192, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_COMMENT", mysql.TypeLongBlob, 0, 0, nil, nil}, - {"DEFINER", mysql.TypeVarchar, 77, mysql.NotNullFlag, nil, nil}, - {"CHARACTER_SET_CLIENT", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"COLLATION_CONNECTION", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"DATABASE_COLLATION", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, + {name: "SPECIFIC_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ROUTINE_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "ROUTINE_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ROUTINE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ROUTINE_TYPE", tp: mysql.TypeVarchar, size: 9, flag: mysql.NotNullFlag}, + {name: "DATA_TYPE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "CHARACTER_MAXIMUM_LENGTH", tp: mysql.TypeLong, size: 21}, + {name: "CHARACTER_OCTET_LENGTH", tp: mysql.TypeLong, size: 21}, + {name: "NUMERIC_PRECISION", tp: mysql.TypeLonglong, size: 21}, + {name: "NUMERIC_SCALE", tp: mysql.TypeLong, size: 21}, + {name: "DATETIME_PRECISION", tp: mysql.TypeLonglong, size: 21}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "COLLATION_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "DTD_IDENTIFIER", tp: mysql.TypeLongBlob}, + {name: "ROUTINE_BODY", tp: mysql.TypeVarchar, size: 8, flag: mysql.NotNullFlag}, + {name: "ROUTINE_DEFINITION", tp: mysql.TypeLongBlob}, + {name: "EXTERNAL_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "EXTERNAL_LANGUAGE", tp: mysql.TypeVarchar, size: 64}, + {name: "PARAMETER_STYLE", tp: mysql.TypeVarchar, size: 8, flag: mysql.NotNullFlag}, + {name: "IS_DETERMINISTIC", tp: mysql.TypeVarchar, size: 3, flag: mysql.NotNullFlag}, + {name: "SQL_DATA_ACCESS", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "SQL_PATH", tp: mysql.TypeVarchar, size: 64}, + {name: "SECURITY_TYPE", tp: mysql.TypeVarchar, size: 7, flag: mysql.NotNullFlag}, + {name: "CREATED", tp: mysql.TypeDatetime, flag: mysql.NotNullFlag, deflt: "0000-00-00 00:00:00"}, + {name: "LAST_ALTERED", tp: mysql.TypeDatetime, flag: mysql.NotNullFlag, deflt: "0000-00-00 00:00:00"}, + {name: "SQL_MODE", tp: mysql.TypeVarchar, size: 8192, flag: mysql.NotNullFlag}, + {name: "ROUTINE_COMMENT", tp: mysql.TypeLongBlob}, + {name: "DEFINER", tp: mysql.TypeVarchar, size: 77, flag: mysql.NotNullFlag}, + {name: "CHARACTER_SET_CLIENT", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "COLLATION_CONNECTION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "DATABASE_COLLATION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, } var tableParametersCols = []columnInfo{ - {"SPECIFIC_CATALOG", mysql.TypeVarchar, 512, mysql.NotNullFlag, nil, nil}, - {"SPECIFIC_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"SPECIFIC_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ORDINAL_POSITION", mysql.TypeVarchar, 21, mysql.NotNullFlag, nil, nil}, - {"PARAMETER_MODE", mysql.TypeVarchar, 5, 0, nil, nil}, - {"PARAMETER_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DATA_TYPE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"CHARACTER_MAXIMUM_LENGTH", mysql.TypeVarchar, 21, 0, nil, nil}, - {"CHARACTER_OCTET_LENGTH", mysql.TypeVarchar, 21, 0, nil, nil}, - {"NUMERIC_PRECISION", mysql.TypeVarchar, 21, 0, nil, nil}, - {"NUMERIC_SCALE", mysql.TypeVarchar, 21, 0, nil, nil}, - {"DATETIME_PRECISION", mysql.TypeVarchar, 21, 0, nil, nil}, - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"COLLATION_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DTD_IDENTIFIER", mysql.TypeLongBlob, 0, mysql.NotNullFlag, nil, nil}, - {"ROUTINE_TYPE", mysql.TypeVarchar, 9, mysql.NotNullFlag, nil, nil}, + {name: "SPECIFIC_CATALOG", tp: mysql.TypeVarchar, size: 512, flag: mysql.NotNullFlag}, + {name: "SPECIFIC_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "SPECIFIC_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ORDINAL_POSITION", tp: mysql.TypeVarchar, size: 21, flag: mysql.NotNullFlag}, + {name: "PARAMETER_MODE", tp: mysql.TypeVarchar, size: 5}, + {name: "PARAMETER_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "DATA_TYPE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "CHARACTER_MAXIMUM_LENGTH", tp: mysql.TypeVarchar, size: 21}, + {name: "CHARACTER_OCTET_LENGTH", tp: mysql.TypeVarchar, size: 21}, + {name: "NUMERIC_PRECISION", tp: mysql.TypeVarchar, size: 21}, + {name: "NUMERIC_SCALE", tp: mysql.TypeVarchar, size: 21}, + {name: "DATETIME_PRECISION", tp: mysql.TypeVarchar, size: 21}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "COLLATION_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "DTD_IDENTIFIER", tp: mysql.TypeLongBlob, flag: mysql.NotNullFlag}, + {name: "ROUTINE_TYPE", tp: mysql.TypeVarchar, size: 9, flag: mysql.NotNullFlag}, } var tableEventsCols = []columnInfo{ - {"EVENT_CATALOG", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"EVENT_SCHEMA", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"EVENT_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"DEFINER", mysql.TypeVarchar, 77, mysql.NotNullFlag, nil, nil}, - {"TIME_ZONE", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"EVENT_BODY", mysql.TypeVarchar, 8, mysql.NotNullFlag, nil, nil}, - {"EVENT_DEFINITION", mysql.TypeLongBlob, 0, 0, nil, nil}, - {"EVENT_TYPE", mysql.TypeVarchar, 9, mysql.NotNullFlag, nil, nil}, - {"EXECUTE_AT", mysql.TypeDatetime, 0, 0, nil, nil}, - {"INTERVAL_VALUE", mysql.TypeVarchar, 256, 0, nil, nil}, - {"INTERVAL_FIELD", mysql.TypeVarchar, 18, 0, nil, nil}, - {"SQL_MODE", mysql.TypeVarchar, 8192, mysql.NotNullFlag, nil, nil}, - {"STARTS", mysql.TypeDatetime, 0, 0, nil, nil}, - {"ENDS", mysql.TypeDatetime, 0, 0, nil, nil}, - {"STATUS", mysql.TypeVarchar, 18, mysql.NotNullFlag, nil, nil}, - {"ON_COMPLETION", mysql.TypeVarchar, 12, mysql.NotNullFlag, nil, nil}, - {"CREATED", mysql.TypeDatetime, 0, mysql.NotNullFlag, "0000-00-00 00:00:00", nil}, - {"LAST_ALTERED", mysql.TypeDatetime, 0, mysql.NotNullFlag, "0000-00-00 00:00:00", nil}, - {"LAST_EXECUTED", mysql.TypeDatetime, 0, 0, nil, nil}, - {"EVENT_COMMENT", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"ORIGINATOR", mysql.TypeLong, 10, mysql.NotNullFlag, 0, nil}, - {"CHARACTER_SET_CLIENT", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"COLLATION_CONNECTION", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"DATABASE_COLLATION", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, + {name: "EVENT_CATALOG", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "EVENT_SCHEMA", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "EVENT_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "DEFINER", tp: mysql.TypeVarchar, size: 77, flag: mysql.NotNullFlag}, + {name: "TIME_ZONE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "EVENT_BODY", tp: mysql.TypeVarchar, size: 8, flag: mysql.NotNullFlag}, + {name: "EVENT_DEFINITION", tp: mysql.TypeLongBlob}, + {name: "EVENT_TYPE", tp: mysql.TypeVarchar, size: 9, flag: mysql.NotNullFlag}, + {name: "EXECUTE_AT", tp: mysql.TypeDatetime}, + {name: "INTERVAL_VALUE", tp: mysql.TypeVarchar, size: 256}, + {name: "INTERVAL_FIELD", tp: mysql.TypeVarchar, size: 18}, + {name: "SQL_MODE", tp: mysql.TypeVarchar, size: 8192, flag: mysql.NotNullFlag}, + {name: "STARTS", tp: mysql.TypeDatetime}, + {name: "ENDS", tp: mysql.TypeDatetime}, + {name: "STATUS", tp: mysql.TypeVarchar, size: 18, flag: mysql.NotNullFlag}, + {name: "ON_COMPLETION", tp: mysql.TypeVarchar, size: 12, flag: mysql.NotNullFlag}, + {name: "CREATED", tp: mysql.TypeDatetime, flag: mysql.NotNullFlag, deflt: "0000-00-00 00:00:00"}, + {name: "LAST_ALTERED", tp: mysql.TypeDatetime, flag: mysql.NotNullFlag, deflt: "0000-00-00 00:00:00"}, + {name: "LAST_EXECUTED", tp: mysql.TypeDatetime}, + {name: "EVENT_COMMENT", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "ORIGINATOR", tp: mysql.TypeLong, size: 10, flag: mysql.NotNullFlag, deflt: 0}, + {name: "CHARACTER_SET_CLIENT", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "COLLATION_CONNECTION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "DATABASE_COLLATION", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, } var tableGlobalStatusCols = []columnInfo{ - {"VARIABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"VARIABLE_VALUE", mysql.TypeVarchar, 1024, 0, nil, nil}, + {name: "VARIABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "VARIABLE_VALUE", tp: mysql.TypeVarchar, size: 1024}, } var tableGlobalVariablesCols = []columnInfo{ - {"VARIABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"VARIABLE_VALUE", mysql.TypeVarchar, 1024, 0, nil, nil}, + {name: "VARIABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "VARIABLE_VALUE", tp: mysql.TypeVarchar, size: 1024}, } var tableSessionStatusCols = []columnInfo{ - {"VARIABLE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, nil, nil}, - {"VARIABLE_VALUE", mysql.TypeVarchar, 1024, 0, nil, nil}, + {name: "VARIABLE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag}, + {name: "VARIABLE_VALUE", tp: mysql.TypeVarchar, size: 1024}, } var tableOptimizerTraceCols = []columnInfo{ - {"QUERY", mysql.TypeLongBlob, 0, mysql.NotNullFlag, "", nil}, - {"TRACE", mysql.TypeLongBlob, 0, mysql.NotNullFlag, "", nil}, - {"MISSING_BYTES_BEYOND_MAX_MEM_SIZE", mysql.TypeShort, 20, mysql.NotNullFlag, 0, nil}, - {"INSUFFICIENT_PRIVILEGES", mysql.TypeTiny, 1, mysql.NotNullFlag, 0, nil}, + {name: "QUERY", tp: mysql.TypeLongBlob, flag: mysql.NotNullFlag, deflt: ""}, + {name: "TRACE", tp: mysql.TypeLongBlob, flag: mysql.NotNullFlag, deflt: ""}, + {name: "MISSING_BYTES_BEYOND_MAX_MEM_SIZE", tp: mysql.TypeShort, size: 20, flag: mysql.NotNullFlag, deflt: 0}, + {name: "INSUFFICIENT_PRIVILEGES", tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, deflt: 0}, } var tableTableSpacesCols = []columnInfo{ - {"TABLESPACE_NAME", mysql.TypeVarchar, 64, mysql.NotNullFlag, "", nil}, - {"ENGINE", mysql.TypeVarchar, 64, mysql.NotNullFlag, "", nil}, - {"TABLESPACE_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LOGFILE_GROUP_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"EXTENT_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AUTOEXTEND_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"MAXIMUM_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"NODEGROUP_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"TABLESPACE_COMMENT", mysql.TypeVarchar, 2048, 0, nil, nil}, + {name: "TABLESPACE_NAME", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, + {name: "ENGINE", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, + {name: "TABLESPACE_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "LOGFILE_GROUP_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "EXTENT_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "AUTOEXTEND_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "MAXIMUM_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "NODEGROUP_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "TABLESPACE_COMMENT", tp: mysql.TypeVarchar, size: 2048}, } var tableCollationCharacterSetApplicabilityCols = []columnInfo{ - {"COLLATION_NAME", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, - {"CHARACTER_SET_NAME", mysql.TypeVarchar, 32, mysql.NotNullFlag, nil, nil}, + {name: "COLLATION_NAME", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, + {name: "CHARACTER_SET_NAME", tp: mysql.TypeVarchar, size: 32, flag: mysql.NotNullFlag}, } var tableProcesslistCols = []columnInfo{ - {"ID", mysql.TypeLonglong, 21, mysql.NotNullFlag, 0, nil}, - {"USER", mysql.TypeVarchar, 16, mysql.NotNullFlag, "", nil}, - {"HOST", mysql.TypeVarchar, 64, mysql.NotNullFlag, "", nil}, - {"DB", mysql.TypeVarchar, 64, 0, nil, nil}, - {"COMMAND", mysql.TypeVarchar, 16, mysql.NotNullFlag, "", nil}, - {"TIME", mysql.TypeLong, 7, mysql.NotNullFlag, 0, nil}, - {"STATE", mysql.TypeVarchar, 7, 0, nil, nil}, - {"INFO", mysql.TypeString, 512, 0, nil, nil}, - {"MEM", mysql.TypeLonglong, 21, 0, nil, nil}, - {"TxnStart", mysql.TypeVarchar, 64, mysql.NotNullFlag, "", nil}, + {name: "ID", tp: mysql.TypeLonglong, size: 21, flag: mysql.NotNullFlag, deflt: 0}, + {name: "USER", tp: mysql.TypeVarchar, size: 16, flag: mysql.NotNullFlag, deflt: ""}, + {name: "HOST", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, + {name: "DB", tp: mysql.TypeVarchar, size: 64}, + {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: "MEM", tp: mysql.TypeLonglong, size: 21}, + {name: "TxnStart", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, } var tableTiDBIndexesCols = []columnInfo{ - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"NON_UNIQUE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"KEY_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SEQ_IN_INDEX", mysql.TypeLonglong, 21, 0, nil, nil}, - {"COLUMN_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SUB_PART", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_COMMENT", mysql.TypeVarchar, 2048, 0, nil, nil}, - {"Expression", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INDEX_ID", mysql.TypeLonglong, 21, 0, nil, nil}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "NON_UNIQUE", tp: mysql.TypeLonglong, size: 21}, + {name: "KEY_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "SEQ_IN_INDEX", tp: mysql.TypeLonglong, size: 21}, + {name: "COLUMN_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "SUB_PART", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_COMMENT", tp: mysql.TypeVarchar, size: 2048}, + {name: "Expression", tp: mysql.TypeVarchar, size: 64}, + {name: "INDEX_ID", tp: mysql.TypeLonglong, size: 21}, } var slowQueryCols = []columnInfo{ - {variable.SlowLogTimeStr, mysql.TypeTimestamp, 26, 0, nil, nil}, - {variable.SlowLogTxnStartTSStr, mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {variable.SlowLogUserStr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogHostStr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogConnIDStr, mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {variable.SlowLogQueryTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogParseTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCompileTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.PreWriteTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.BinlogPrewriteTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.CommitTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.GetCommitTSTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.CommitBackoffTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.BackoffTypesStr, mysql.TypeVarchar, 64, 0, nil, nil}, - {execdetails.ResolveLockTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.LocalLatchWaitTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.WriteKeysStr, mysql.TypeLonglong, 22, 0, nil, nil}, - {execdetails.WriteSizeStr, mysql.TypeLonglong, 22, 0, nil, nil}, - {execdetails.PrewriteRegionStr, mysql.TypeLonglong, 22, 0, nil, nil}, - {execdetails.TxnRetryStr, mysql.TypeLonglong, 22, 0, nil, nil}, - {execdetails.ProcessTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.WaitTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.BackoffTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.LockKeysTimeStr, mysql.TypeDouble, 22, 0, nil, nil}, - {execdetails.RequestCountStr, mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {execdetails.TotalKeysStr, mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {execdetails.ProcessKeysStr, mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {variable.SlowLogDBStr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogIndexNamesStr, mysql.TypeVarchar, 100, 0, nil, nil}, - {variable.SlowLogIsInternalStr, mysql.TypeTiny, 1, 0, nil, nil}, - {variable.SlowLogDigestStr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogStatsInfoStr, mysql.TypeVarchar, 512, 0, nil, nil}, - {variable.SlowLogCopProcAvg, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopProcP90, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopProcMax, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopProcAddr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogCopWaitAvg, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopWaitP90, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopWaitMax, mysql.TypeDouble, 22, 0, nil, nil}, - {variable.SlowLogCopWaitAddr, mysql.TypeVarchar, 64, 0, nil, nil}, - {variable.SlowLogMemMax, mysql.TypeLonglong, 20, 0, nil, nil}, - {variable.SlowLogSucc, mysql.TypeTiny, 1, 0, nil, nil}, - {variable.SlowLogPlan, mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {variable.SlowLogPlanDigest, mysql.TypeVarchar, 128, 0, nil, nil}, - {variable.SlowLogPrevStmt, mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, - {variable.SlowLogQuerySQLStr, mysql.TypeLongBlob, types.UnspecifiedLength, 0, nil, nil}, + {name: variable.SlowLogTimeStr, tp: mysql.TypeTimestamp, size: 26}, + {name: variable.SlowLogTxnStartTSStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: variable.SlowLogUserStr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogHostStr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogConnIDStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: variable.SlowLogQueryTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogParseTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCompileTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.PreWriteTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.BinlogPrewriteTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.CommitTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.GetCommitTSTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.CommitBackoffTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.BackoffTypesStr, tp: mysql.TypeVarchar, size: 64}, + {name: execdetails.ResolveLockTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.LocalLatchWaitTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.WriteKeysStr, tp: mysql.TypeLonglong, size: 22}, + {name: execdetails.WriteSizeStr, tp: mysql.TypeLonglong, size: 22}, + {name: execdetails.PrewriteRegionStr, tp: mysql.TypeLonglong, size: 22}, + {name: execdetails.TxnRetryStr, tp: mysql.TypeLonglong, size: 22}, + {name: execdetails.ProcessTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.WaitTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.BackoffTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.LockKeysTimeStr, tp: mysql.TypeDouble, size: 22}, + {name: execdetails.RequestCountStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: execdetails.TotalKeysStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: execdetails.ProcessKeysStr, tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: variable.SlowLogDBStr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogIndexNamesStr, tp: mysql.TypeVarchar, size: 100}, + {name: variable.SlowLogIsInternalStr, tp: mysql.TypeTiny, size: 1}, + {name: variable.SlowLogDigestStr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogStatsInfoStr, tp: mysql.TypeVarchar, size: 512}, + {name: variable.SlowLogCopProcAvg, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopProcP90, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopProcMax, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopProcAddr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogCopWaitAvg, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopWaitP90, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopWaitMax, tp: mysql.TypeDouble, size: 22}, + {name: variable.SlowLogCopWaitAddr, tp: mysql.TypeVarchar, size: 64}, + {name: variable.SlowLogMemMax, tp: mysql.TypeLonglong, size: 20}, + {name: variable.SlowLogSucc, tp: mysql.TypeTiny, size: 1}, + {name: variable.SlowLogPlan, tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: variable.SlowLogPlanDigest, tp: mysql.TypeVarchar, size: 128}, + {name: variable.SlowLogPrevStmt, tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, + {name: variable.SlowLogQuerySQLStr, tp: mysql.TypeLongBlob, size: types.UnspecifiedLength}, } var tableTiDBHotRegionsCols = []columnInfo{ - {"TABLE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DB_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INDEX_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"REGION_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"MAX_HOT_DEGREE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"REGION_COUNT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"FLOW_BYTES", mysql.TypeLonglong, 21, 0, nil, nil}, + {name: "TABLE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "DB_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "INDEX_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "REGION_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "MAX_HOT_DEGREE", tp: mysql.TypeLonglong, size: 21}, + {name: "REGION_COUNT", tp: mysql.TypeLonglong, size: 21}, + {name: "FLOW_BYTES", tp: mysql.TypeLonglong, size: 21}, } var tableTiKVStoreStatusCols = []columnInfo{ - {"STORE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"ADDRESS", mysql.TypeVarchar, 64, 0, nil, nil}, - {"STORE_STATE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"STORE_STATE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LABEL", mysql.TypeJSON, 51, 0, nil, nil}, - {"VERSION", mysql.TypeVarchar, 64, 0, nil, nil}, - {"CAPACITY", mysql.TypeVarchar, 64, 0, nil, nil}, - {"AVAILABLE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LEADER_COUNT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"LEADER_WEIGHT", mysql.TypeDouble, 22, 0, nil, nil}, - {"LEADER_SCORE", mysql.TypeDouble, 22, 0, nil, nil}, - {"LEADER_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"REGION_COUNT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"REGION_WEIGHT", mysql.TypeDouble, 22, 0, nil, nil}, - {"REGION_SCORE", mysql.TypeDouble, 22, 0, nil, nil}, - {"REGION_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"START_TS", mysql.TypeDatetime, 0, 0, nil, nil}, - {"LAST_HEARTBEAT_TS", mysql.TypeDatetime, 0, 0, nil, nil}, - {"UPTIME", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "STORE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "ADDRESS", tp: mysql.TypeVarchar, size: 64}, + {name: "STORE_STATE", tp: mysql.TypeLonglong, size: 21}, + {name: "STORE_STATE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "LABEL", tp: mysql.TypeJSON, size: 51}, + {name: "VERSION", tp: mysql.TypeVarchar, size: 64}, + {name: "CAPACITY", tp: mysql.TypeVarchar, size: 64}, + {name: "AVAILABLE", tp: mysql.TypeVarchar, size: 64}, + {name: "LEADER_COUNT", tp: mysql.TypeLonglong, size: 21}, + {name: "LEADER_WEIGHT", tp: mysql.TypeDouble, size: 22}, + {name: "LEADER_SCORE", tp: mysql.TypeDouble, size: 22}, + {name: "LEADER_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "REGION_COUNT", tp: mysql.TypeLonglong, size: 21}, + {name: "REGION_WEIGHT", tp: mysql.TypeDouble, size: 22}, + {name: "REGION_SCORE", tp: mysql.TypeDouble, size: 22}, + {name: "REGION_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "START_TS", tp: mysql.TypeDatetime}, + {name: "LAST_HEARTBEAT_TS", tp: mysql.TypeDatetime}, + {name: "UPTIME", tp: mysql.TypeVarchar, size: 64}, } var tableAnalyzeStatusCols = []columnInfo{ - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PARTITION_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"JOB_INFO", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PROCESSED_ROWS", mysql.TypeLonglong, 20, mysql.UnsignedFlag, nil, nil}, - {"START_TIME", mysql.TypeDatetime, 0, 0, nil, nil}, - {"STATE", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "PARTITION_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "JOB_INFO", tp: mysql.TypeVarchar, size: 64}, + {name: "PROCESSED_ROWS", tp: mysql.TypeLonglong, size: 20, flag: mysql.UnsignedFlag}, + {name: "START_TIME", tp: mysql.TypeDatetime}, + {name: "STATE", tp: mysql.TypeVarchar, size: 64}, } var tableTiKVRegionStatusCols = []columnInfo{ - {"REGION_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"START_KEY", mysql.TypeBlob, types.UnspecifiedLength, 0, nil, nil}, - {"END_KEY", mysql.TypeBlob, types.UnspecifiedLength, 0, nil, nil}, - {"TABLE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DB_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"IS_INDEX", mysql.TypeTiny, 1, mysql.NotNullFlag, 0, nil}, - {"INDEX_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"EPOCH_CONF_VER", mysql.TypeLonglong, 21, 0, nil, nil}, - {"EPOCH_VERSION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"WRITTEN_BYTES", mysql.TypeLonglong, 21, 0, nil, nil}, - {"READ_BYTES", mysql.TypeLonglong, 21, 0, nil, nil}, - {"APPROXIMATE_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"APPROXIMATE_KEYS", mysql.TypeLonglong, 21, 0, nil, nil}, + {name: "REGION_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "START_KEY", tp: mysql.TypeBlob, size: types.UnspecifiedLength}, + {name: "END_KEY", tp: mysql.TypeBlob, size: types.UnspecifiedLength}, + {name: "TABLE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "DB_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "IS_INDEX", tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, deflt: 0}, + {name: "INDEX_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "EPOCH_CONF_VER", tp: mysql.TypeLonglong, size: 21}, + {name: "EPOCH_VERSION", tp: mysql.TypeLonglong, size: 21}, + {name: "WRITTEN_BYTES", tp: mysql.TypeLonglong, size: 21}, + {name: "READ_BYTES", tp: mysql.TypeLonglong, size: 21}, + {name: "APPROXIMATE_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "APPROXIMATE_KEYS", tp: mysql.TypeLonglong, size: 21}, } var tableTiKVRegionPeersCols = []columnInfo{ - {"REGION_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"PEER_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"STORE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"IS_LEARNER", mysql.TypeTiny, 1, mysql.NotNullFlag, 0, nil}, - {"IS_LEADER", mysql.TypeTiny, 1, mysql.NotNullFlag, 0, nil}, - {"STATUS", mysql.TypeVarchar, 10, 0, 0, nil}, - {"DOWN_SECONDS", mysql.TypeLonglong, 21, 0, 0, nil}, + {name: "REGION_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "PEER_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "STORE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "IS_LEARNER", tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, deflt: 0}, + {name: "IS_LEADER", tp: mysql.TypeTiny, size: 1, flag: mysql.NotNullFlag, deflt: 0}, + {name: "STATUS", tp: mysql.TypeVarchar, size: 10, deflt: 0}, + {name: "DOWN_SECONDS", tp: mysql.TypeLonglong, size: 21, deflt: 0}, } var tableTiDBServersInfoCols = []columnInfo{ - {"DDL_ID", mysql.TypeVarchar, 64, 0, nil, nil}, - {"IP", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PORT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"STATUS_PORT", mysql.TypeLonglong, 21, 0, nil, nil}, - {"LEASE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"VERSION", mysql.TypeVarchar, 64, 0, nil, nil}, - {"GIT_HASH", mysql.TypeVarchar, 64, 0, nil, nil}, - {"BINLOG_STATUS", mysql.TypeVarchar, 64, 0, nil, nil}, + {name: "DDL_ID", tp: mysql.TypeVarchar, size: 64}, + {name: "IP", tp: mysql.TypeVarchar, size: 64}, + {name: "PORT", tp: mysql.TypeLonglong, size: 21}, + {name: "STATUS_PORT", tp: mysql.TypeLonglong, size: 21}, + {name: "LEASE", tp: mysql.TypeVarchar, size: 64}, + {name: "VERSION", tp: mysql.TypeVarchar, size: 64}, + {name: "GIT_HASH", tp: mysql.TypeVarchar, size: 64}, + {name: "BINLOG_STATUS", tp: mysql.TypeVarchar, size: 64}, } var tableClusterConfigCols = []columnInfo{ - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"KEY", mysql.TypeVarchar, 256, 0, nil, nil}, - {"VALUE", mysql.TypeVarchar, 128, 0, nil, nil}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "KEY", tp: mysql.TypeVarchar, size: 256}, + {name: "VALUE", tp: mysql.TypeVarchar, size: 128}, } var tableClusterLogCols = []columnInfo{ - {"TIME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LEVEL", mysql.TypeVarchar, 8, 0, nil, nil}, - {"MESSAGE", mysql.TypeVarString, 1024, 0, nil, nil}, + {name: "TIME", tp: mysql.TypeVarchar, size: 32}, + {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}, } var tableClusterLoadCols = []columnInfo{ - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEVICE_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEVICE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"NAME", mysql.TypeVarchar, 256, 0, nil, nil}, - {"VALUE", mysql.TypeVarchar, 128, 0, nil, nil}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "DEVICE_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "DEVICE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "NAME", tp: mysql.TypeVarchar, size: 256}, + {name: "VALUE", tp: mysql.TypeVarchar, size: 128}, } var tableClusterHardwareCols = []columnInfo{ - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEVICE_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DEVICE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"NAME", mysql.TypeVarchar, 256, 0, nil, nil}, - {"VALUE", mysql.TypeVarchar, 128, 0, nil, nil}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "DEVICE_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "DEVICE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "NAME", tp: mysql.TypeVarchar, size: 256}, + {name: "VALUE", tp: mysql.TypeVarchar, size: 128}, } var tableClusterSystemInfoCols = []columnInfo{ - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SYSTEM_TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SYSTEM_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"NAME", mysql.TypeVarchar, 256, 0, nil, nil}, - {"VALUE", mysql.TypeVarchar, 128, 0, nil, nil}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "SYSTEM_TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "SYSTEM_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "NAME", tp: mysql.TypeVarchar, size: 256}, + {name: "VALUE", tp: mysql.TypeVarchar, size: 128}, +} + +var filesCols = []columnInfo{ + {name: "FILE_ID", tp: mysql.TypeLonglong, size: 4}, + {name: "FILE_NAME", tp: mysql.TypeVarchar, size: 4000}, + {name: "FILE_TYPE", tp: mysql.TypeVarchar, size: 20}, + {name: "TABLESPACE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_CATALOG", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "LOGFILE_GROUP_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "LOGFILE_GROUP_NUMBER", tp: mysql.TypeLonglong, size: 32}, + {name: "ENGINE", tp: mysql.TypeVarchar, size: 64}, + {name: "FULLTEXT_KEYS", tp: mysql.TypeVarchar, size: 64}, + {name: "DELETED_ROWS", tp: mysql.TypeLonglong, size: 4}, + {name: "UPDATE_COUNT", tp: mysql.TypeLonglong, size: 4}, + {name: "FREE_EXTENTS", tp: mysql.TypeLonglong, size: 4}, + {name: "TOTAL_EXTENTS", tp: mysql.TypeLonglong, size: 4}, + {name: "EXTENT_SIZE", tp: mysql.TypeLonglong, size: 4}, + {name: "INITIAL_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "MAXIMUM_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "AUTOEXTEND_SIZE", tp: mysql.TypeLonglong, size: 21}, + {name: "CREATION_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "LAST_UPDATE_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "LAST_ACCESS_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "RECOVER_TIME", tp: mysql.TypeLonglong, size: 4}, + {name: "TRANSACTION_COUNTER", tp: mysql.TypeLonglong, size: 4}, + {name: "VERSION", tp: mysql.TypeLonglong, size: 21}, + {name: "ROW_FORMAT", tp: mysql.TypeVarchar, size: 10}, + {name: "TABLE_ROWS", tp: mysql.TypeLonglong, size: 21}, + {name: "AVG_ROW_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "MAX_DATA_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "INDEX_LENGTH", tp: mysql.TypeLonglong, size: 21}, + {name: "DATA_FREE", tp: mysql.TypeLonglong, size: 21}, + {name: "CREATE_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "UPDATE_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "CHECK_TIME", tp: mysql.TypeDatetime, size: -1}, + {name: "CHECKSUM", tp: mysql.TypeLonglong, size: 21}, + {name: "STATUS", tp: mysql.TypeVarchar, size: 20}, + {name: "EXTRA", tp: mysql.TypeVarchar, size: 255}, +} + +var tableClusterInfoCols = []columnInfo{ + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "STATUS_ADDRESS", tp: mysql.TypeVarchar, size: 64}, + {name: "VERSION", tp: mysql.TypeVarchar, size: 64}, + {name: "GIT_HASH", tp: mysql.TypeVarchar, size: 64}, + {name: "START_TIME", tp: mysql.TypeVarchar, size: 32}, + {name: "UPTIME", tp: mysql.TypeVarchar, size: 32}, +} + +var tableTableTiFlashReplicaCols = []columnInfo{ + {name: "TABLE_SCHEMA", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "TABLE_ID", tp: mysql.TypeLonglong, size: 21}, + {name: "REPLICA_COUNT", tp: mysql.TypeLonglong, size: 64}, + {name: "LOCATION_LABELS", tp: mysql.TypeVarchar, size: 64}, + {name: "AVAILABLE", tp: mysql.TypeTiny, size: 1}, + {name: "PROGRESS", tp: mysql.TypeDouble, size: 22}, +} + +var tableInspectionResultCols = []columnInfo{ + {name: "RULE", tp: mysql.TypeVarchar, size: 64}, + {name: "ITEM", tp: mysql.TypeVarchar, size: 64}, + {name: "TYPE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "VALUE", tp: mysql.TypeVarchar, size: 64}, + {name: "REFERENCE", tp: mysql.TypeVarchar, size: 64}, + {name: "SEVERITY", tp: mysql.TypeVarchar, size: 64}, + {name: "DETAILS", tp: mysql.TypeVarchar, size: 256}, +} + +var tableInspectionSummaryCols = []columnInfo{ + {name: "RULE", tp: mysql.TypeVarchar, size: 64}, + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "METRICS_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "LABEL", tp: mysql.TypeVarchar, size: 64}, + {name: "QUANTILE", tp: mysql.TypeDouble, size: 22}, + {name: "AVG_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MIN_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MAX_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, +} + +var tableMetricTablesCols = []columnInfo{ + {name: "TABLE_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "PROMQL", tp: mysql.TypeVarchar, size: 64}, + {name: "LABELS", tp: mysql.TypeVarchar, size: 64}, + {name: "QUANTILE", tp: mysql.TypeDouble, size: 22}, + {name: "COMMENT", tp: mysql.TypeVarchar, size: 256}, +} + +var tableMetricSummaryCols = []columnInfo{ + {name: "METRICS_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "QUANTILE", tp: mysql.TypeDouble, size: 22}, + {name: "SUM_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "AVG_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MIN_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MAX_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "COMMENT", tp: mysql.TypeVarchar, size: 256}, +} + +var tableMetricSummaryByLabelCols = []columnInfo{ + {name: "INSTANCE", tp: mysql.TypeVarchar, size: 64}, + {name: "METRICS_NAME", tp: mysql.TypeVarchar, size: 64}, + {name: "LABEL", tp: mysql.TypeVarchar, size: 64}, + {name: "QUANTILE", tp: mysql.TypeDouble, size: 22}, + {name: "SUM_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "AVG_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MIN_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "MAX_VALUE", tp: mysql.TypeDouble, size: 22, decimal: 6}, + {name: "COMMENT", tp: mysql.TypeVarchar, size: 256}, } func dataForTiKVRegionStatus(ctx sessionctx.Context) (records [][]types.Datum, err error) { @@ -1125,119 +1239,6 @@ func dataForEngines() (records [][]types.Datum) { return records } -var filesCols = []columnInfo{ - {"FILE_ID", mysql.TypeLonglong, 4, 0, nil, nil}, - {"FILE_NAME", mysql.TypeVarchar, 4000, 0, nil, nil}, - {"FILE_TYPE", mysql.TypeVarchar, 20, 0, nil, nil}, - {"TABLESPACE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_CATALOG", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LOGFILE_GROUP_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LOGFILE_GROUP_NUMBER", mysql.TypeLonglong, 32, 0, nil, nil}, - {"ENGINE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"FULLTEXT_KEYS", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DELETED_ROWS", mysql.TypeLonglong, 4, 0, nil, nil}, - {"UPDATE_COUNT", mysql.TypeLonglong, 4, 0, nil, nil}, - {"FREE_EXTENTS", mysql.TypeLonglong, 4, 0, nil, nil}, - {"TOTAL_EXTENTS", mysql.TypeLonglong, 4, 0, nil, nil}, - {"EXTENT_SIZE", mysql.TypeLonglong, 4, 0, nil, nil}, - {"INITIAL_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"MAXIMUM_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AUTOEXTEND_SIZE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CREATION_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"LAST_UPDATE_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"LAST_ACCESS_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"RECOVER_TIME", mysql.TypeLonglong, 4, 0, nil, nil}, - {"TRANSACTION_COUNTER", mysql.TypeLonglong, 4, 0, nil, nil}, - {"VERSION", mysql.TypeLonglong, 21, 0, nil, nil}, - {"ROW_FORMAT", mysql.TypeVarchar, 10, 0, nil, nil}, - {"TABLE_ROWS", mysql.TypeLonglong, 21, 0, nil, nil}, - {"AVG_ROW_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"MAX_DATA_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"INDEX_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil}, - {"DATA_FREE", mysql.TypeLonglong, 21, 0, nil, nil}, - {"CREATE_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"UPDATE_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"CHECK_TIME", mysql.TypeDatetime, -1, 0, nil, nil}, - {"CHECKSUM", mysql.TypeLonglong, 21, 0, nil, nil}, - {"STATUS", mysql.TypeVarchar, 20, 0, nil, nil}, - {"EXTRA", mysql.TypeVarchar, 255, 0, nil, nil}, -} - -var tableClusterInfoCols = []columnInfo{ - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"STATUS_ADDRESS", mysql.TypeVarchar, 64, 0, nil, nil}, - {"VERSION", mysql.TypeVarchar, 64, 0, nil, nil}, - {"GIT_HASH", mysql.TypeVarchar, 64, 0, nil, nil}, - {"START_TIME", mysql.TypeVarchar, 32, 0, nil, nil}, - {"UPTIME", mysql.TypeVarchar, 32, 0, nil, nil}, -} - -var tableTableTiFlashReplicaCols = []columnInfo{ - {"TABLE_SCHEMA", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TABLE_ID", mysql.TypeLonglong, 21, 0, nil, nil}, - {"REPLICA_COUNT", mysql.TypeLonglong, 64, 0, nil, nil}, - {"LOCATION_LABELS", mysql.TypeVarchar, 64, 0, nil, nil}, - {"AVAILABLE", mysql.TypeTiny, 1, 0, nil, nil}, - {"PROGRESS", mysql.TypeDouble, 22, 0, nil, nil}, -} - -var tableInspectionResultCols = []columnInfo{ - {"RULE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"ITEM", mysql.TypeVarchar, 64, 0, nil, nil}, - {"TYPE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"VALUE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"REFERENCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"SEVERITY", mysql.TypeVarchar, 64, 0, nil, nil}, - {"DETAILS", mysql.TypeVarchar, 256, 0, nil, nil}, -} - -var tableInspectionSummaryCols = []columnInfo{ - {"RULE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"METRICS_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LABEL", mysql.TypeVarchar, 64, 0, nil, nil}, - {"QUANTILE", mysql.TypeDouble, 22, 0, nil, nil}, - {"AVG_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MIN_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MAX_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, -} - -var tableMetricTablesCols = []columnInfo{ - {"TABLE_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"PROMQL", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LABELS", mysql.TypeVarchar, 64, 0, nil, nil}, - {"QUANTILE", mysql.TypeDouble, 22, 0, nil, nil}, - {"COMMENT", mysql.TypeVarchar, 256, 0, nil, nil}, -} - -var tableMetricSummaryCols = []columnInfo{ - {"METRICS_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"QUANTILE", mysql.TypeDouble, 22, 0, nil, nil}, - {"SUM_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"AVG_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MIN_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MAX_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"COMMENT", mysql.TypeVarchar, 256, 0, nil, nil}, -} - -var tableMetricSummaryByLabelCols = []columnInfo{ - {"INSTANCE", mysql.TypeVarchar, 64, 0, nil, nil}, - {"METRICS_NAME", mysql.TypeVarchar, 64, 0, nil, nil}, - {"LABEL", mysql.TypeVarchar, 64, 0, nil, nil}, - {"QUANTILE", mysql.TypeDouble, 22, 0, nil, nil}, - {"SUM_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"AVG_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MIN_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"MAX_VALUE", mysql.TypeDouble, 22, 0, nil, nil}, - {"COMMENT", mysql.TypeVarchar, 256, 0, nil, nil}, -} - func getRowCountAllTable(ctx sessionctx.Context) (map[int64]uint64, error) { rows, _, err := ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL("select table_id, count from mysql.stats_meta") if err != nil {