-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `t1` (
`emp_id` int(11) NOT NULL,
`emp_name` varchar(25) NOT NULL,
`salary` int(11) NOT NULL,
`dept_id` int(11) NOT NULL,
PRIMARY KEY (`emp_id`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
PARTITION BY RANGE (`emp_id`)
(PARTITION `p0` VALUES LESS THAN (1000),
PARTITION `p1` VALUES LESS THAN (4000),
PARTITION `p2` VALUES LESS THAN (12000),
PARTITION `p3` VALUES LESS THAN (16000),
PARTITION `p4` VALUES LESS THAN (20000),
PARTITION `p5` VALUES LESS THAN (25000),
PARTITION `p6` VALUES LESS THAN (30000),
PARTITION `p7` VALUES LESS THAN (35000),
PARTITION `p8` VALUES LESS THAN (40000),
PARTITION `p9` VALUES LESS THAN (45000),
PARTITION `p10` VALUES LESS THAN (50000),
PARTITION `p11` VALUES LESS THAN (55000),
PARTITION `p12` VALUES LESS THAN (65000),
PARTITION `p13` VALUES LESS THAN (75000),
PARTITION `p14` VALUES LESS THAN (85000),
PARTITION `p15` VALUES LESS THAN (95000),
PARTITION `p16` VALUES LESS THAN (105000),
PARTITION `p17` VALUES LESS THAN (115000),
PARTITION `p18` VALUES LESS THAN (125000),
PARTITION `pmax` VALUES LESS THAN (MAXVALUE));
set cte_max_recursion_depth = 1000000000;
insert into
employees3 WITH RECURSIVE EmployeeGenerator AS (
SELECT
101 AS emp_id,
'Emp00001' AS emp_name,
FLOOR(RAND() * (150000 - 50000) + 50000) AS salary,
FLOOR(RAND() * 3 + 1) AS dept_id
UNION
ALL
SELECT
emp_id + 1,
CONCAT('Emp', LPAD(CAST(emp_id - 100 AS CHAR), 5, '0')),
FLOOR(RAND() * (150000 - 50000) + 50000),
FLOOR(RAND() * 3 + 1)
FROM
EmployeeGenerator
WHERE
emp_id < 20100
)
SELECT
*
FROM
EmployeeGenerator;
analyze table employees3 partition p12;
show stats_histograms where table_name='employees3' and Column_name='PRIMARY'
2. What did you expect to see? (Required)
it should be not zero.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.severity/majorsig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.