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

Fix FunctionalDependencies for NonUnique, NonNull indexes on Server #2665

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Sep 17, 2024

When using the server engine, we return an error for indexes defined over non-unique not null columns.
This meant that filters over these columns would incorrectly return error when there were duplicate entries.
Oddly, this only happens on server engine and not using dolt sql-shell directly.

The bug stems from a missing check when gathering functional dependencies for equalities.

Related: dolthub/dolt#8365

@jycor jycor changed the title test Fix FunctionalDependencies for NonUnique, NonNull indexes on Server Sep 17, 2024
Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm

return conj.hist, conj.getFds(), true, conj.missingPrefix, nil
var conjFDs *sql.FuncDepSet
if idx.IsUnique() {
conjFDs = conj.getFds()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: i would have maybe put the check inside the helper function, in case it gets used elsewhere

@jycor jycor merged commit e3846f5 into main Sep 18, 2024
8 checks passed
@jycor jycor deleted the james/funcdeps branch September 18, 2024 04:32
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.

2 participants