[improvement](index)add index_id column in show index stmt (#30431)

This commit is contained in:
qiye
2024-01-30 10:17:20 +08:00
committed by yiguolei
parent 08897b7e03
commit b712f0b810
10 changed files with 168 additions and 166 deletions

View File

@ -46,6 +46,7 @@ public class ShowIndexStmt extends ShowStmt {
.addColumn(new Column("Index_type", ScalarType.createVarchar(80)))
.addColumn(new Column("Comment", ScalarType.createVarchar(80)))
.addColumn(new Column("Properties", ScalarType.createVarchar(200)))
.addColumn(new Column("Index_id", ScalarType.createVarchar(30)))
.build();
private String dbName;
private TableName tableName;

View File

@ -1082,7 +1082,8 @@ public class ShowExecutor {
for (Index index : indexes) {
rows.add(Lists.newArrayList(showStmt.getTableName().toString(), "", index.getIndexName(),
"", String.join(",", index.getColumns()), "", "", "", "",
"", index.getIndexType().name(), index.getComment(), index.getPropertiesString()));
"", index.getIndexType().name(), index.getComment(), index.getPropertiesString(),
String.valueOf(index.getIndexId())));
}
} finally {
table.readUnlock();