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

Changed FILTER expressions to consider ENUM/SET types #512

Merged
merged 1 commit into from
Jul 29, 2021

Conversation

Hydrocharged
Copy link
Contributor

Previously a statement such as UPDATE test SET col = 2 WHERE col = 1; would fail for ENUM and SET types. For the FILTER node, we only consider the values for comparison, but the aforementioned types can match 'horse' with the number 50, so we have to consider the column type.

Now this PR only affects ENUM and SET, although it's probably correct that all types should be used, with direct literal comparisons being used only when no other type can be derived from a column or variable. However, either MySQL has context-aware comparisons (my guess), or our comparison logic is wrong for other types, so I'm leaving those alone for now.

@Hydrocharged Hydrocharged requested a review from zachmu July 29, 2021 18:11
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LG, just a couple comments

sql/expression/comparison.go Outdated Show resolved Hide resolved
enginetest/script_queries.go Outdated Show resolved Hide resolved
@Hydrocharged Hydrocharged merged commit aca7418 into master Jul 29, 2021
@Hydrocharged Hydrocharged deleted the daylon/filter-col-type branch July 29, 2021 20:52
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