|
Posted by Andy Hassall on 11/05/05 01:06
On Fri, 04 Nov 2005 14:21:21 -0600, Justin Koivisto <justin@koivi.com> wrote:
>IIRC, MySQL will actually give an error if you to quote a value for an
>integer field...
mysql> create table t (c int);
Query OK, 0 rows affected (0.05 sec)
mysql> insert into t values ('1');
Query OK, 1 row affected (0.03 sec)
mysql> select * from t;
+------+
| c |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
MySQL still has a nasty habit of mangling data to fit, rather than raising
errors.
mysql> create table t (c varchar(1));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t values ('clearly too long');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> select * from t;
+------+
| c |
+------+
| c |
+------+
1 row in set (0.00 sec)
OK, it's come up with a "warning" but that's a bit more than a warning. I
believe MySQL 5.0 has an option at last to turn these into errors.
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Navigation:
[Reply to this message]
|