« Recipe for true geeks. | Main | In case you where wondering... »

Tip: MySQL is not that helpful sometimes

Stupid problem today.

In a listing I had, I had a percent column. The problem was that the database definition for that column was wrong, it used DECIMAL(2,4). Yes, 100% will not fit in there. Also: this syntax was valid in 3.x but with 5.x you need DECIMAL(6,4). I'm using now DECIMAL(7,4) to fit the edge case.

My peeve with MySQL is that if I give him 100 to put in that column he will not complain nor store NULL. He will help you and store 99.9999.

But the problem was the lack of a test for the edge case. Added, committed, happy happy joy joy.

Contacts

melo@simplicidade.org (XMPP/email)
+351 302 029 050 (voice)
melopt (Skype)

IronMan challenge

Iron Man badge Are you ready to be an Iron Man? Join the challenge and find out! (what is the meaning of this little man?)

Moosaico

Junta-te!

Recent Comments

Powered by Disqus
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.2