Bug #120890 reply for bug#120821
Submitted: 8 Jul 6:48 Modified: 8 Jul 11:11
Reporter: cl hl Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:9.5.0 OS:Any
Assigned to: CPU Architecture:Any

[8 Jul 6:48] cl hl
Description:
Thanks for your reply

The total SQL used to reproduce this bug#120821:
https://bugs.mysql.com/bug.php?id=120821

How to repeat:

DROP DATABASE IF EXISTS round90_repro_small;
CREATE DATABASE round90_repro_small;
USE round90_repro_small;

CREATE TABLE t1 (
    c1 INT NOT NULL AUTO_INCREMENT,
    c2 VARCHAR(255) NOT NULL,
    c3 VARCHAR(255) NULL,
    c4 INT NULL,
    c5 DATE NOT NULL,
    c6 VARCHAR(10) NOT NULL,
    PRIMARY KEY (c1)
);

CREATE INDEX idx_t1_c6_c5 ON t1 (c6, c5);

INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (1, 'a', 'b', 1, '2025-01-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (2, 'a', 'b', 1, '2025-02-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (3, 'a', 'b', 1, '2025-03-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (4, 'a', 'b', 1, '2025-04-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (5, 'a', 'b', 1, '2025-05-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (6, 'a', 'b', 1, '2025-06-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (7, 'a', 'b', 1, '2025-07-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (8, 'a', 'b', 1, '2025-08-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (9, 'a', 'b', 1, '2025-09-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (10, 'a', 'b', 1, '2025-10-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (11, 'a', 'b', 1, '2025-11-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (12, 'a', 'b', 1, '2025-12-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (13, 'a', 'b', 1, '2026-01-01', 'x');
INSERT INTO t1 (c1, c2, c3, c4, c5, c6) VALUES (14, 'a', 'b', 1, '2026-02-01', 'x');

-- original
SELECT subq.c1 % subq.c1 AS col_1
FROM (
  SELECT s906.c3 AS c3, s906.c1 AS c1, s906.c5 AS c5
  FROM t1 AS s906
  WHERE s906.c5 < '2023-01-01 04:13:04'
) AS subq
WHERE CHAR_LENGTH(REPEAT(subq.c1, subq.c5)) <= 70;

-- mutated
SELECT subq.c1 % subq.c1 AS col_1
FROM (
  SELECT DISTINCT s906.c3 AS c3, s906.c1 AS c1, s906.c5 AS c5
  FROM t1 AS s906
  WHERE s906.c5 < '2023-01-01 04:13:04'
) AS subq
WHERE CHAR_LENGTH(REPEAT(subq.c1, subq.c5)) <= 70;
[8 Jul 11:11] MySQL Verification Team
Please continue in the bug #120821
[8 Jul 11:14] Chaithra Marsur Gopala Reddy
I have updated the Bug#120821 with this test case and verified that bug.