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" #14156

Closed
wshwsh12 opened this issue Feb 7, 2023 · 0 comments · Fixed by #14149
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 affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 severity/major type/bug Type: Issue - Confirmed a bug

Comments

@wshwsh12
Copy link
Contributor

wshwsh12 commented Feb 7, 2023

Bug Report

pingcap/tidb#40341

What version of TiKV are you using?

master

What operating system and CPU are you using?

Steps to reproduce

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

What did you expect?

What did happened?

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

ti-chi-bot added a commit 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 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 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 affects-6.0 affects-6.1 affects-6.2 affects-6.3 affects-6.4 affects-6.5 severity/major type/bug Type: Issue - Confirmed a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants