Here is a very interesting issue in MySQL database.
SQL truncation occurs when you try to insert/update a field with a string which is longer than the maximum length defined in the table structure.
For instance if you defined a column
name as a varchar(8) and you provide
abracadabra wich is 11, MySQL will truncate the string to 8 and will insert
No message, no warning, nothing at all. This flaw can lead to security issue in some case.
First I create this small table:
CREATE TABLE IF NOT EXISTS `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `login` varchar(8) NOT NULL, `passwd` varchar(64) NOT NULL, PRIMARY KEY (`id`) );