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

enhance conflictdetector package #1040

Open
wk989898 opened this issue Feb 25, 2025 · 0 comments · May be fixed by #1042
Open

enhance conflictdetector package #1040

wk989898 opened this issue Feb 25, 2025 · 0 comments · May be fixed by #1042
Labels
type/refactor The issue belongs to a refactor work.

Comments

@wk989898
Copy link
Collaborator

Is your feature request related to a problem?

No

Describe the feature you'd like

The column info and data are linked by their index rather than by column ID. This necessitates sorting the columns to maintain alignment with the column information, which is both imprecise and unreliable.

for _, i := range colIdx {
// If the index contain generated column, we can't use this key to detect conflict with other DML,
if columnInfos[i] == nil || tableInfo.GetColumnFlags()[columnInfos[i].ID].IsGeneratedColumn() {
return nil, nil
}
value, err := common.FormatColVal(row, columnInfos[i], i)
if err != nil {
return nil, err
}
// if a column value is null, we can ignore this index
if value == nil {
return nil, nil
}
val := model.ColumnValueString(value)
if columnNeeds2LowerCase(columnInfos[i].GetType(), columnInfos[i].GetCollate()) {
val = strings.ToLower(val)
}
key = append(key, []byte(val)...)
key = append(key, 0)
}

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

@wk989898 wk989898 added the type/refactor The issue belongs to a refactor work. label Feb 25, 2025
@wk989898 wk989898 linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/refactor The issue belongs to a refactor work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant