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

query got tikv error "other error: [components/tidb_query_expr/src/types/expr_builder.rs:74]: Unsupported expression type MysqlEnum" #40341

Closed
wjhuang2016 opened this issue Jan 5, 2023 · 1 comment · Fixed by tikv/tikv#14149
Assignees
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 fuzz/schrddl severity/major sig/execution SIG execution type/bug This issue is a bug.

Comments

@wjhuang2016
Copy link
Member

wjhuang2016 commented Jan 5, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `3d4cb6ef-0f1d-4251-8bfa-597151b12faf` (
  `4f7b3506-819c-4d2a-b9f7-83d435afcbfa` smallint(6) NOT NULL DEFAULT '-5122',
  `ed811e32-79ef-407f-b0aa-c26cfab07039` decimal(31,5) NOT NULL DEFAULT '-58273067513829223182570619.25537',
  PRIMARY KEY (`4f7b3506-819c-4d2a-b9f7-83d435afcbfa`,`ed811e32-79ef-407f-b0aa-c26cfab07039`) /*T![clustered_index] CLUSTERED */
);

CREATE TABLE `19034a25-1533-4252-8b25-abbdd6969f26` (
  `2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8` mediumint(9) NOT NULL DEFAULT '-4139846',
  `1593583d-41c7-4143-b6a3-ccd5220fad20` enum('j50s','8','4a3yi','kv','lf5b','j','ky76i','q','el','xy','9') DEFAULT 'q',
  `ba579924-abe2-42b3-8f78-b3aad6369dfc` enum('n0pr','u7x','qt','0msar','zrr4','b2b3n','t','xv6','rnw','7cqno','x3elq') DEFAULT 'b2b3n',
  `279ef64e-beab-41cf-acac-998f925c1da1` timestamp DEFAULT '2014-09-29 07:13:02',
  `f4e3f70d-6654-43bd-8ac4-9249ea076743` enum('c','3','he','p2','pww','ux9ib','xk1fg','ws1n','mgiz1','2','j8vj') NOT NULL DEFAULT 'pww',
  `4f52ced6-03a4-48d5-a875-899e78069dc9` decimal(45,23) DEFAULT '7130795821065799090555.21999951481601315693236',
  `4f06def2-7f89-4fab-9567-fa29aa828993` year(4) DEFAULT '1968',
  PRIMARY KEY (`f4e3f70d-6654-43bd-8ac4-9249ea076743`,`2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8`) /*T![clustered_index] CLUSTERED */,
  KEY `6abfc501-2a14-40ce-ac53-20b10798b194` (`f4e3f70d-6654-43bd-8ac4-9249ea076743`),
  KEY `0350a244-83ba-4377-9045-a0a9c1483346` (`4f52ced6-03a4-48d5-a875-899e78069dc9`),
  KEY `b972c93b-78c6-42f1-9f30-2b139429b36d` (`f4e3f70d-6654-43bd-8ac4-9249ea076743`,`2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8`,`4f52ced6-03a4-48d5-a875-899e78069dc9`,`1593583d-41c7-4143-b6a3-ccd5220fad20`,`279ef64e-beab-41cf-acac-998f925c1da1`),
  UNIQUE KEY `f981fc15-052a-49e7-9ae7-4c9904e80379` (`f4e3f70d-6654-43bd-8ac4-9249ea076743`,`279ef64e-beab-41cf-acac-998f925c1da1`,`2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin COMMENT='f5d35eed-b7c8-4acc-a3dc-cfdb3c70f576'
PARTITION BY HASH (`2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8`) PARTITIONS 6;

INSERT INTO `19034a25-1533-4252-8b25-abbdd6969f26` VALUES (-7186257,'ky76i','u7x','1985-07-19 16:00:00','p2',62465.40000000000000000000000,1973),(5449941,'el','zrr4','1993-11-18 16:00:00','ws1n',46929.20000000000000000000000,2006),(-4139846,'el','t','2025-06-27 16:00:00','',7130795821065799090555.21999951481601315693236,1996),(4562822,'lf5b','b2b3n','2016-04-15 16:00:00','ux9ib',55415.20000000000000000000000,2021),(4841120,'q','b2b3n','2025-06-27 16:00:00','2',7130795821065799090555.21999951481601315693236,1968),(-209341,'el','t','2025-06-27 16:00:00','',0.09000000000000000000000,1982),(-1047955,'el','t','2025-06-27 16:00:00','c',0.50000000000000000000000,1983),(-7984447,'el','t','1979-10-23 16:00:00','xk1fg',2.30600000000000000000000,2011),(3699259,'j50s','n0pr','1979-12-09 16:00:00','xk1fg',367.70340000000000000000000,2028),(-7625501,'8','t','2030-01-05 16:00:00','c',12864.00000000000000000000000,2025),(-2982875,'lf5b','t','1981-04-02 16:00:00','c',42.00000000000000000000000,2000),(2030843,'xy',NULL,'2013-07-08 16:00:00','he',3446.40000000000000000000000,2004),(7599611,'el','t','2025-06-27 16:00:00','ws1n',7130795821065799090555.21999951481601315693236,1968);

INSERT INTO `3d4cb6ef-0f1d-4251-8bfa-597151b12faf` VALUES (-26167,-71962604850603508117163388.41295),(-20311,35958677810997277612112850.64947),(-10584,7.04220),(-10584,903981.60700),(-10584,96361735411871213251545173.82569),(-5122,68904.10000),(5999,7.04220),(29452,7.04220);

select  field( `19034a25-1533-4252-8b25-abbdd6969f26`.`279ef64e-beab-41cf-acac-998f925c1da1` , `19034a25-1533-4252-8b25-abbdd6969f26`.`279ef64e-beab-41cf-acac-998f925c1da1` , `19034a25-1533-4252-8b25-abbdd6969f26`.`2285ff2b-896f-4dfe-a7d5-b7f7fd7a8bc8` )
as r0 from `19034a25-1533-4252-8b25-abbdd6969f26` where not( `19034a25-1533-4252-8b25-abbdd6969f26`.`f4e3f70d-6654-43bd-8ac4-9249ea076743` in ( select `ed811e32-79ef-407f-b0aa-c26cfab07039` from `3d4cb6ef-0f1d-4251-8bfa-597151b12faf` where `19034a25-1533-4252-8b25-abbdd6969f26`.`1593583d-41c7-4143-b6a3-ccd5220fad20` in ( select `ed811e32-79ef-407f-b0aa-c26cfab07039` from `3d4cb6ef-0f1d-4251-8bfa-597151b12faf` where `19034a25-1533-4252-8b25-abbdd6969f26`.`ba579924-abe2-42b3-8f78-b3aad6369dfc` >= 'qt' and not( `19034a25-1533-4252-8b25-abbdd6969f26`.`ba579924-abe2-42b3-8f78-b3aad6369dfc` <> 'u7x' ) ) and not( `19034a25-1533-4252-8b25-abbdd6969f26`.`f4e3f70d-6654-43bd-8ac4-9249ea076743` between 'mgiz1' and 'ws1n' ) ) );

2. What did you expect to see? (Required)

No error

3. What did you see instead (Required)

other error: [components/tidb_query_expr/src/types/expr_builder.rs:74]: Unsupported expression type MysqlEnum

4. What is your TiDB version? (Required)

master

@wjhuang2016 wjhuang2016 added the type/bug This issue is a bug. label Jan 5, 2023
@wshwsh12 wshwsh12 self-assigned this Jan 12, 2023
@jebter
Copy link

jebter commented Feb 6, 2023

block fuzz/schrddl test

@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 may-affects-6.5 labels Feb 6, 2023
@wshwsh12 wshwsh12 added affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 labels Feb 7, 2023
@ti-chi-bot ti-chi-bot removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 may-affects-6.5 labels Feb 7, 2023
@wshwsh12 wshwsh12 removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Feb 7, 2023
ti-chi-bot added a commit to tikv/tikv that referenced this issue Feb 7, 2023
close #14156, close pingcap/tidb#40341

copr: fix error when cast const Enum to any type

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
ti-chi-bot added a commit to tikv/tikv that referenced this issue Feb 16, 2023
ref #14149, close #14156, close pingcap/tidb#40341

copr: fix error when cast const Enum to any type

Signed-off-by: wshwsh12 <793703860@qq.com>

Co-authored-by: wshwsh12 <793703860@qq.com>
ti-chi-bot added a commit to tikv/tikv that referenced this issue Mar 31, 2023
ref #14149, close #14156, close pingcap/tidb#40341

copr: fix error when cast const Enum to any type

Signed-off-by: wshwsh12 <793703860@qq.com>

Co-authored-by: wshwsh12 <793703860@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 fuzz/schrddl severity/major sig/execution SIG execution type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants