Here is nice gotcha which I've seen many times and which can
cause just a minefield for many reasons.
Lets say you had a system storing articles and you use article_id as unsigned int. As the time goes and you see you may get over 4 billions of articles you change the type for article_id to bigint unsigned but forget linked tables.
PLAIN TEXT SQL:
- mysql> CREATE TABLE article_comment(article_id int UNSIGNED NOT NULL, comment_id int UNSIGNED NOT NULL, KEY(article_id));
- Query OK, 0 rows affected (0.11 sec)
- mysql> INSERT INTO article_comment VALUES(4300000000,1);
- Query OK, 1 row affected, 1 warning (0.00 sec)
- mysql> INSERT INTO article_comment VALUES(4300000001,1); …