Bug #21388 Delete of a bigint failed.
Submitted: 1 Aug 2006 14:06 Modified: 5 Aug 2006 19:42
Reporter: Horst Hunger Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1.12-Beta (06.07.19) OS:Linux (Suse 10.1)
Assigned to: Assigned Account CPU Architecture:Any

[1 Aug 2006 14:06] Horst Hunger
Description:
The following log files shows the execution of the same statementes except that the table in the second log is with partitioning:

1. log:
SET @max_row = 20;
create table t1 (a bigint unsigned not null, primary key(a)) engine='MYISAM' ;
show create table t1;
Table   Create Table
t1      CREATE TABLE `t1` (
  `a` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
18446744073709551615
select * from t1 where a=18446744073709551615;
a
18446744073709551615
delete from t1 where a=18446744073709551615;
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614

2. log:
SET @max_row = 20;
create table t1 (a bigint unsigned not null, primary key(a)) engine='MYISAM'
partition by key (a) partitions 10;
show create table t1;
Table   Create Table
t1      CREATE TABLE `t1` (
  `a` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10  */
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
18446744073709551615
select * from t1 where a=18446744073709551615;
a
delete from t1 where a=18446744073709551615;
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
18446744073709551615

How to repeat:
execute the following statments with and without partitioning:

create table t1 (a bigint unsigned not null, primary key(a)) 
partition by key (a) partitions 10;
show create table t1;
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t1;
select * from t1 where a=18446744073709551615;
# select * from t1 where a='18446744073709551615';
delete from t1 where a=18446744073709551615;
select * from t1;
#drop table t1;
[1 Aug 2006 15:25] MySQL Verification Team
Thank you for the bug report.
[5 Aug 2006 19:42] Mikael Ronström
Duplicate of bug#20257 which was pushed to 5.1 at 2 aug, 1 day after it
was verified.