Bug #10357 in decimal, the space for the negative sign is not reserved for negative sign
Submitted: 4 May 2005 13:50 Modified: 23 Jul 2005 15:19
Reporter: Gerard Goossen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.22 OS:Linux (linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[4 May 2005 13:50] Gerard Goossen
Description:
in decimal, the space for the negative sign is not reserved for the negative sign.

So with decimal(4,2) you can store "123.45", resulting in that 
update foo set bar=-bar;
update foo set bar=-bar;
is not the identity.

How to repeat:
create table foo (bar decimal(4,2));
insert into foo values ("123.45");
select * from foo;

update foo set bar=-bar;
update foo set bar=-bar;
select * from foo;
[23 Jul 2005 15:19] Alexey Botchkov
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

I don't see anything wrong with this behaviour.
Declaring the field DECIMAL(4,2) you specify that
[-]99.99 is the maximum value to store.
So bigger values can be stored inproperly.