Bug #31401 bigint unsigned non-deterministic near wrap values
Submitted: 4 Oct 2007 16:05 Modified: 4 Nov 2007 19:06
Reporter: Peter Brawley (Basic Quality Contributor) Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.1.22 OS:Windows (w2k sp4)
Assigned to: CPU Architecture:Any
Tags: qc

[4 Oct 2007 16:05] Peter Brawley
Description:
Bigint columns non-deterministic near wrap values.

How to repeat:
drop table if exists t;
create table t(id bigint unsigned);
INSERT INTO t VALUES (1,18446744073709551614),(18446744073709551615);
SELECT id,id-1,id-2,id-3 from t where id=1;
+------+------+----------------------+----------------------+
| id   | id-1 | id-2                 | id-3                 |
+------+------+----------------------+----------------------+
|    1 |    0 | 18446744073709551615 | 18446744073709551614 |
+------+------+----------------------+----------------------+
SELECT id,id-1000 from t;
+----------------------+----------------------+
| id                   | id-1000              |
+----------------------+----------------------+
|                    1 | 18446744073709550617 |
| 18446744073709551614 | 18446744073709550614 |
| 18446744073709551615 | 18446744073709550615 |
+----------------------+----------------------+
[/code]
Do some other queries, then come back and repeat the above query:
[code]
select id,id-1000 from t;
+------+----------------------+
| id   | id-1000              |
+------+----------------------+
|    1 | 18446744073709550617 |
|    0 | 18446744073709550616 |
|    1 | 18446744073709550617 |
+------+----------------------+
[/code]
Bigint unsigned wrap is non-deterministic.
[4 Oct 2007 17:44] Valeriy Kravchuk
Thank you for a problem report. Please, send the exact queries you executed in between to get inconsistent results.
[4 Oct 2007 18:38] Peter Brawley
Hmmm, cannot replicate it.
[4 Oct 2007 19:06] Valeriy Kravchuk
Same here, hence the request...
[5 Nov 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".