Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#55814
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
Defined2014 authored and ti-chi-bot committed Sep 6, 2024
1 parent 973b215 commit 16f1f9b
Show file tree
Hide file tree
Showing 3 changed files with 775 additions and 1 deletion.
7 changes: 6 additions & 1 deletion executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,11 @@ func (e *memtableRetriever) setDataForStatisticsInTable(schema *model.DBInfo, ta
expression = tblCol.GeneratedExprString
}

var subPart any
if key.Length != types.UnspecifiedLength {
subPart = key.Length
}

record := types.MakeDatums(
infoschema.CatalogVal, // TABLE_CATALOG
schema.Name.O, // TABLE_SCHEMA
Expand All @@ -598,7 +603,7 @@ func (e *memtableRetriever) setDataForStatisticsInTable(schema *model.DBInfo, ta
colName, // COLUMN_NAME
"A", // COLLATION
0, // CARDINALITY
nil, // SUB_PART
subPart, // SUB_PART
nil, // PACKED
nullable, // NULLABLE
"BTREE", // INDEX_TYPE
Expand Down
Loading

0 comments on commit 16f1f9b

Please sign in to comment.