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

Enum value can be queried by its underlying numeric value (written as text) #62701

Open
sylph-eu opened this issue Apr 16, 2024 · 0 comments
Open

Comments

@sylph-eu
Copy link

Describe the unexpected behaviour

SELECT version()

┌─version()─┐
│ 23.8.9.54 │
└───────────┘

create table e (value Enum('hello', 'world')) ENGINE = Log;  -- OK
insert into e values('hello');                               -- OK

-- Query 'hello' by its underlying numeric value
select value from e where value = '1'      -- BAD: it should have failed probably
┌─value─┐
│ hello │
└───────┘
-- value IN ('1') also works


select value from e where value = '3'      -- OK: this one fails

Expected behavior
I would expect value = '1' or value IN ('1') to fail with "Unknown element error".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant