Bug #107623 Server hangs on inserting record in partitioned table with auto inc column
Submitted: 21 Jun 2022 14:34 Modified: 21 Jun 2022 14:42
Reporter: Rahul Sisondia (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.23 OS:Any
Assigned to: CPU Architecture:Any
Tags: Auto-increment, partition table

[21 Jun 2022 14:34] Rahul Sisondia
Description:
If there is partitioned table that has an auto increment column. 
If user does not specify the column value while inserting a record then it should be generated and record should be inserted. 
Even if the use case is not supported then insert should throw error. 
At the momoment innodb hangs without any useful error in the logs. 

How to repeat:
CREATE TABLE `sales2` (
  `agent_code` int NOT NULL AUTO_INCREMENT,
  `amount` int NOT NULL,
  PRIMARY KEY (`agent_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
/*!50100 PARTITION BY LIST (`agent_code`)
(PARTITION pA VALUES IN (1,2,3) TABLESPACE = `innodb_system` ENGINE = InnoDB,
 PARTITION pB VALUES IN (4,5,6) TABLESPACE = `innodb_system` ENGINE = InnoDB,
 PARTITION pC VALUES IN (7,8,9,10,11) TABLESPACE = `innodb_system` ENGINE = InnoDB; 

mysql> insert into sales2(amount) values(300);

Suggested fix:
- Either support the use case or throw error.
[21 Jun 2022 14:42] Rahul Sisondia
I created the bug by mistake. It is not an issue.