Skip to content

Reproduce UNION coercion bug #165

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

Open
wants to merge 1 commit into
base: release-19.0-github
Choose a base branch
from

Conversation

meiji163
Copy link

@meiji163 meiji163 commented Jun 27, 2025

Description

In release-19.0-github, a cross-shard UNION query with enum will fail with error coercion should not try to coerce this value: ENUM("b") (errno 1815) (sqlstate HY000)

go test -v -run 'TestUnion$' ./go/test/endtoend/vtgate/queries/union/...

Test:

CREATE TABLE t2(
  id3 bigint,
  id4 bigint, /* lookup vindex on id4 */
  e ENUM('a','b','c') DEFAULT 'a',
  primary key(id3)
) Engine=InnoDB;
INSERT INTO t2(id3, id4, e) VALUES (1,1,'a'), (2,2,'b'), (3,1,'a'), (4,2,'b');
(SELECT id3, e from t2 where e = 'a' and id4 = 1) union (SELECT e, id3 from t2 where e='b' and id4 = 2);

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 22:02
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

1 participant