On 04-06-2011 01:16, Darren Duncan wrote:
> b.  That's just an example of how MySQL silently ignores lots of errors or 
> silently changes data on you, such as silently truncating text values that 
> are 
> too long for a field when you insert them, so you've lost data without even 
> knowing it.  (Okay, I knew about this one previously.)

It does not do so,
it gives a warning,
its up to the user to decide if something is done with that.....

10:44:31 root@test[16]mysql> desc test1;
+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| id      | int(8)      | NO   | PRI | NULL    | auto_increment |
| USER_ID | int(8)      | NO   | MUL | NULL    |                |
| TEXT    | varchar(64) | NO   |     | NULL    |                |
+---------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

10:44:38 root@test[17]mysql> select * from test1 where user_id=9999;
Empty set (0.00 sec)

10:44:49 root@test[18]mysql> insert into test1 (user_id, text) values
(9999,'abcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyzabcdefghijklmnqrstuvwxyz');
Query OK, 1 row affected, 1 warning (0.00 sec)

10:45:04 root@test[19]mysql> show warnings;
+---------+------+-------------------------------------------+
| Level   | Code | Message                                   |
+---------+------+-------------------------------------------+
| Warning | 1265 | Data truncated for column 'TEXT' at row 1 |
+---------+------+-------------------------------------------+
1 row in set (0.00 sec)

10:45:19 root@test[20]mysql>

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to