← Back to team overview

maria-developers team mailing list archive

New (by Monty): Give warnings in case of overflow in integer arithmetic (65)

 

-----------------------------------------------------------------------
                              WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Give warnings in case of overflow in integer arithmetic
CREATION DATE..: Wed, 18 Nov 2009, 01:20
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....: 
COPIES TO......: 
CATEGORY.......: Server-RawIdeaBin
TASK ID........: 65 (http://askmonty.org/worklog/?tid=65)
VERSION........: Benchmarks-3.0
STATUS.........: Un-Assigned
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 40 (hours remain)
ORIG. ESTIMATE.: 40

PROGRESS NOTES:



DESCRIPTION:

Give warnings in case of overflow in integer arithmetic

The issue is described here:

http://bugs.launchpad.net/maria/+bug/482846

MySQL reason is descried here:

http://dev.mysql.com/doc/refman/5.1/en/arithmetic-functions.html

We can't fix the arithmetic as it would make us incompatible in how MySQL works.
We should however see if we can generate warnings when overflows
happens.

mysql> SELECT 4294967296 * 4294967296;
+-------------------------+
| 4294967296 * 4294967296 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)

mysql> show warnings;
Empty set (0.00 sec)

mysql> SELECT 3037000500 * 3037000500;
+-------------------------+
| 3037000500 * 3037000500 |
+-------------------------+
| -9223372036709301616 |
+-------------------------+
1 row in set (0.00 sec)

mysql> show warnings;
Empty set (0.00 sec)

mysql> SELECT 4294967296 * 4294967297;
+-------------------------+
| 4294967296 * 4294967297 |
+-------------------------+
| 4294967296 |
+-------------------------+
1 row in set (0.00 sec)

mysql> show warnings;
Empty set (0.00 sec)

mysql> SELECT 4294967296 * 4294967298;
+-------------------------+
| 4294967296 * 4294967298 |
+-------------------------+
| 8589934592 |
+-------------------------+
1 row in set (0.00 sec)

mysql> show warnings;
Empty set (0.00 sec)


ESTIMATED WORK TIME

ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)