Bug #105075 part field of unsigned bigint type
Submitted: 29 Sep 2021 13:00 Modified: 29 Sep 2021 13:31
Reporter: Boy Zhang Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[29 Sep 2021 13:00] Boy Zhang
Description:
When defining a range columns partition table and the part field is of unsigned bigint type, i cannot create a partition with a part range greater than LLONG_MAX.

How to repeat:
mysql-> CREATE TABLE t ( id BIGINT UNSIGNED, k INT )
PARTITION BY RANGE COLUMNS(id) (
  PARTITION part1 VALUES LESS THAN(10)
);

mysql-> alter table t add partition (partition p0 values less than(9223372036854775816));

Suggested fix:
I think the problem is mainly caused by generate_partition_syntax. In the get_cs_converted_part_value_from_string function, the judgment of unsigned_flag should be added to correctly handle unsigned data.
[29 Sep 2021 13:31] MySQL Verification Team
Hi Mr. Zhang,

Thank you for your bug report.

We have tested your commands and analysed the code. This deficiency is found in both 5.7 and 8.0.

Verified as reported.