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

Implicit type casting between enum and string #83169

Closed
Defman opened this issue Jun 22, 2022 · 2 comments
Closed

Implicit type casting between enum and string #83169

Defman opened this issue Jun 22, 2022 · 2 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner

Comments

@Defman
Copy link

Defman commented Jun 22, 2022

Describe the problem

Implicit casting between enum types and primitives/strings.

To Reproduce

CREATE TYPE FOO AS ENUM ('1', '2');
SELECT ARRAY['1'] = ARRAY['1'::FOO]::FOO[];
SELECT '1' = ANY(ARRAY['1'::FOO]::FOO[]);

Expected behavior
That the string '1' is implicitly casted to the enum type.

Jira issue: CRDB-16895

@Defman Defman added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Jun 22, 2022
@blathers-crl
Copy link

blathers-crl bot commented Jun 22, 2022

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I was unable to automatically find someone to ping.

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner labels Jun 22, 2022
@rimadeodhar
Copy link
Collaborator

Implicit type casting is not fully supported within CockroachDB at the moment and is being tracked in this parent issue #75101. In the meantime, the workaround is to explicitly cast a type.

I'm closing this issue as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-untriaged blathers was unable to find an owner
Projects
None yet
Development

No branches or pull requests

2 participants