Skip to content

Don't use non-unique indexes as functional dependencies in AND expressions.#2868

Merged
nicktobey merged 3 commits intomainfrom
nicktobey/max1row
Mar 4, 2025
Merged

Don't use non-unique indexes as functional dependencies in AND expressions.#2868
nicktobey merged 3 commits intomainfrom
nicktobey/max1row

Conversation

@nicktobey
Copy link
Copy Markdown
Contributor

This fixes a customer issue that was causing Error 1105 (HY000): result max1Row iterator returned more than one row

We can probably do better than this: we could tweak it so that adding a FD key on a non-unique index instead adds an implication that the non-unique index key determines the primary key.

But this is a simpler fix in the meantime that makes us more correct.

@nicktobey nicktobey requested a review from max-hoffman March 3, 2025 22:39
@nicktobey nicktobey force-pushed the nicktobey/max1row branch from 842766b to 0c4e082 Compare March 3, 2025 22:45
Copy link
Copy Markdown
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.

I suspect the change here is upstream of the root cause, but it's directionally correct and i agree the plan change is more of a testing artifact than a regression customers using statistics would see

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