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 gets the 'invalid input value' error using distinct #50855

Closed
wjhuang2016 opened this issue Jan 31, 2024 · 1 comment · Fixed by #50146
Closed

query gets the 'invalid input value' error using distinct #50855

wjhuang2016 opened this issue Jan 31, 2024 · 1 comment · Fixed by #50146
Assignees
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. duplicate Issues or pull requests already exists. fuzz/randomtest severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `td880ed5c` (
  `col_64` int(10) unsigned NOT NULL DEFAULT '1786987428',
  `col_65` date DEFAULT '2000-06-23',
  `col_66` bit(34) NOT NULL,
  `col_67` bit(45) NOT NULL DEFAULT b'110110100011111000110011111010101111001111111',
  `col_68` timestamp NOT NULL DEFAULT '1978-09-10 00:00:00',
  `col_69` datetime NOT NULL,
  PRIMARY KEY (`col_64`,`col_66`,`col_68`) /*T![clustered_index] NONCLUSTERED */,
  UNIQUE KEY `idx_20` (`col_64`,`col_68`,`col_67`),
  UNIQUE KEY `idx_21` (`col_64`,`col_67`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
PARTITION BY HASH (`col_64`) PARTITIONS 5;

INSERT INTO `td880ed5c` VALUES (578629008,'2004-02-25',x'01ca56bae5',x'1181e3f5eb87','2031-09-27 00:00:00','2003-08-10 00:00:00'), (3839858149,'2004-02-25',x'01ca56bae5',x'1181e3f5eb87','2004-05-19 00:00:00','2003-08-10 00:00:00'), (986835820,'2004-02-25',x'01ca56bae5',x'1181e3f5eb87','1980-07-02 00:00:00','2003-08-10 00:00:00'), (261076256,'2004-02-25',x'01ca56bae5',x'1181e3f5eb87','2022-03-19 00:00:00','2003-08-10 00:00:00'), (2919688946,'2005-09-17',x'01ca56bae5',x'1181e3f5eb87','2004-05-19 00:00:00','2003-08-10 00:00:00'), (1384945489,'1977-09-16',x'01ca56bae5',x'1181e3f5eb87','1975-02-09 00:00:00','2003-08-10 00:00:00'), (337709001,'1987-12-23',x'01ca56bae5',x'1181e3f5eb87','1970-01-28 00:00:00','2003-08-10 00:00:00'), (210024554,'2024-02-11',x'01ca56bae5',x'1181e3f5eb87','1971-12-08 00:00:00','2003-08-10 00:00:00'), (1037545552,'2021-01-05',x'01ca56bae5',x'1181e3f5eb87','2031-09-26 00:00:00','2003-08-10 00:00:00'), (3528521392,'2035-08-14',x'01ca56bae5',x'1181e3f5eb87','2004-05-19 00:00:00','2003-08-10 00:00:00'), (380854997,'1989-07-27',x'0317b6a819',x'108998d7b78e','2010-04-05 00:00:00','1976-02-03 00:00:00'), (2418657738,'1989-11-14',x'0096728efe',x'000000000000','2004-05-19 00:00:00','1979-05-28 00:00:00'), (3772008620,'1986-06-17',x'0118dad9b2',x'09b0e5368c40','2004-05-19 00:00:00','1988-07-14 00:00:00'), (23805426,'2009-06-16',x'007bdbe821',x'1d7355948576','2029-03-07 00:00:00','1991-04-19 00:00:00'), (3316670611,'2004-12-09',x'01a968eba1',x'1bb0271f09ae','2004-05-19 00:00:00','2031-12-19 00:00:00'), (970863828,'1986-11-23',x'02f16b6322',x'0381fa7829f3','2000-01-28 00:00:00','2011-05-20 00:00:00'), (684334029,'1972-06-29',x'0335f84c7d',x'000000000000','1996-11-28 00:00:00','2001-12-17 00:00:00'), (2,'1989-02-18',x'01a54eac88',x'1e753d9e5a68','2025-11-30 00:00:00','2018-05-28 00:00:00'), (902388330,'2013-06-02',x'03cdd6d237',x'0ea94a15f067','2009-03-18 00:00:00','2017-05-03 00:00:00'), (2011313927,'1997-10-27',x'03cb5eecc7',x'034d097c0c27','2004-05-19 00:00:00','1976-10-01 00:00:00'), (2134534959,'2031-01-17',x'01705e5355',x'12db99b7911d','2004-05-19 00:00:00','1974-11-02 00:00:00'), (1900645116,'2009-06-22',x'021ac27c7a',x'09c47d7de115','2004-05-19 00:00:00','2031-11-11 00:00:00'), (2312394105,'2036-04-06',x'02fdce1dc7',x'000000000000','2004-05-19 00:00:00','2028-11-15 00:00:00'), (3627903068,'1988-11-28',x'0316769a86',x'000000000000','2004-05-19 00:00:00','2001-09-18 00:00:00'), (4068944662,'1997-05-27',x'00b7b9ba8b',x'09a1441d083c','2004-05-19 00:00:00','2001-11-05 00:00:00'), (3323167528,'2022-10-01',x'00d1dc9a8f',x'0b73575ff062','2004-05-19 00:00:00','2031-10-27 00:00:00'), (1700850903,'1979-08-19',x'00ceb49159',x'177aad71c84f','1990-12-26 00:00:00','2002-04-05 00:00:00'), (2147483648,'1982-05-21',x'03f4be40c6',x'000000000000','2004-05-19 00:00:00','2011-01-05 00:00:00'), (2831323145,'2021-06-08',x'01b55f579c',x'0b245632380e','2004-05-19 00:00:00','1974-05-05 00:00:00'), (3007143316,'2012-07-13',x'034f4c3b23',x'1d8d721fdd0f','2004-05-19 00:00:00','1973-11-23 00:00:00'), (2147483648,'1987-01-26',x'0244d051e7',x'1e58767a9954','2004-05-19 00:00:00','2001-05-31 00:00:00'), (24564169,'1988-03-24',x'00c007aaf2',x'0e7a2f96f815','2006-03-05 00:00:00','2000-05-16 00:00:00'), (2160743184,'2026-05-12',x'02ac99da30',x'1ceb1b3996fe','2004-05-19 00:00:00','2029-02-19 00:00:00'), (809621108,'2024-09-30',x'026acb8a28',x'058b613b6088','2031-10-19 00:00:00','1974-12-15 00:00:00'), (2781746953,NULL,x'007603277c',x'116de4426b1e','2004-05-19 00:00:00','1996-06-26 00:00:00'), (3992045312,'2031-05-01',x'0011eeba62',x'1b45c7ea7e88','2004-05-19 00:00:00','2009-04-14 00:00:00'), (777718768,'2019-12-31',x'01d8c8a81d',x'0583ec4e17df','1983-08-27 00:00:00','1970-04-15 00:00:00'), (3411225539,'2029-09-14',x'022ff6f257',x'199e3df35678','1976-10-09 00:00:00','2031-05-07 00:00:00');

SELECT  DISTINCT `td880ed5c`.`col_67` AS `r0`,`td880ed5c`.`col_65` AS `r1`,REVERSE(`td880ed5c`.`col_67`) AS `r2`,`td880ed5c`.`col_67` AS `r3`,`td880ed5c`.`col_67` AS `r4` FROM `td880ed5c` WHERE NOT (`td880ed5c`.`col_69` IN ('1998-01-19','1978-05-29','2035-11-14','2004-04-20'));

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

No error

3. What did you see instead (Required)

mysql> SELECT  DISTINCT `td880ed5c`.`col_67` AS `r0`,`td880ed5c`.`col_65` AS `r1`,REVERSE(`td880ed5c`.`col_67`) AS `r2`,`td880ed5c`.`col_67` AS `r3`,`td880ed5c`.`col_67` AS `r4` FROM `td880ed5c` WHERE NOT (`td880ed5c`.`col_69` IN ('1998-01-19','1978-05-29','2035-11-14','2004-04-20'));
ERROR 1105 (HY000): invalid input value: Utf8Error { valid_up_to: 1, error_len: Some(1) }

4. What is your TiDB version? (Required)

4e41699

@windtalker
Copy link
Contributor

The same as #50850, change the label to sig infra

@windtalker windtalker added sig/sql-infra SIG: SQL Infra and removed sig/execution SIG execution labels Feb 1, 2024
@YangKeao YangKeao self-assigned this Feb 2, 2024
@bb7133 bb7133 added affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 labels Feb 2, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in aa00ae2 Feb 5, 2024
ti-chi-bot bot pushed a commit that referenced this issue Feb 19, 2024
ti-chi-bot bot pushed a commit that referenced this issue Feb 19, 2024
ti-chi-bot bot pushed a commit that referenced this issue Feb 19, 2024
@windtalker windtalker mentioned this issue Feb 23, 2024
18 tasks
@tiancaiamao tiancaiamao added the duplicate Issues or pull requests already exists. label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. duplicate Issues or pull requests already exists. fuzz/randomtest severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants