On Apr 23, 2007, at 9:19, Ovid wrote:

[mysql truncating data values]
>> Upgrade to 5.x and turn on 'STRICT MODE' or SQL STANDARD mode - one
>> or both of those settings will fix that.
>
> I wish :(

No, it really does.

  - ask

mysql> create table t ( foo enum("bar", "baz") ) engine=InnoDB;
Query OK, 0 rows affected (0.07 sec)

mysql> insert into t values ("foobar");
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1265 | Data truncated for column 'foo' at row 1 |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)

mysql> truncate t;
Query OK, 1 row affected (0.05 sec)

mysql> set sql_mode = 'strict_trans_tables';
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t values ("foobar");
ERROR 1265 (01000): Data truncated for column 'foo' at row 1

mysql> select * from t;
Empty set (0.00 sec)


-- 
http://develooper.com/ - http://askask.com/



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to