Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The column IDs in the tables under metrics_schema are 0, which may be problematic for operations that rely on uniqueness. #45761

Closed
zimulala opened this issue Aug 2, 2023 · 2 comments
Assignees
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@zimulala
Copy link
Contributor

zimulala commented Aug 2, 2023

for name, def := range MetricTableMap {
cols := def.genColumnInfos()
tableInfo := buildTableMeta(name, cols)
tableInfo.ID = tableID
tableInfo.Comment = def.Comment
tableID++
metricTables = append(metricTables, tableInfo)
}

func (def *MetricTableDef) genColumnInfos() []columnInfo {
cols := []columnInfo{
{name: "time", tp: mysql.TypeDatetime, size: 19, deflt: "CURRENT_TIMESTAMP"},
}
for _, label := range def.Labels {
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{name: "quantile", tp: mysql.TypeDouble, size: 22, deflt: defaultValue})
}
cols = append(cols, columnInfo{name: "value", tp: mysql.TypeDouble, size: 22})
return cols
}

No value was assigned to column ID.

@zimulala zimulala added type/bug This issue is a bug. severity/minor labels Aug 2, 2023
@zimulala
Copy link
Contributor Author

zimulala commented Aug 2, 2023

Relate PR:#45744

@jebter jebter added the sig/sql-infra SIG: SQL Infra label Aug 2, 2023
@zimulala
Copy link
Contributor Author

zimulala commented Oct 9, 2023

Fixed #45764

@zimulala zimulala closed this as completed Oct 9, 2023
@zimulala zimulala self-assigned this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants