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

only check references for updated columns #2690

Merged
merged 3 commits into from
Oct 11, 2024
Merged

only check references for updated columns #2690

merged 3 commits into from
Oct 11, 2024

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Oct 9, 2024

Copy link
Contributor

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we have to use types.Compare instead of directly comparing the values.

// Only check the reference for the columns that are updated
hasChange := false
for _, idx := range reference.RowMapper.IndexPositions {
if old[idx] != new[idx] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to use type.Compare here. Some values will fail even though they're the same value, like with []byte, since this will compare the slice pointers instead of the contents. Especially relevant for Doltgres.

@jycor jycor merged commit f9668b4 into main Oct 11, 2024
8 checks passed
@jycor jycor deleted the james/fks branch October 11, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When updating rows, Dolt requires all values in the row to satisfy constraints, not just the values changed
2 participants