Gleb,

> > As a sidenote - shouldn't MySQL raise an error when data gets
>truncated?
>
> MySQL raises a warning after such ALTER operation. See:
>
> mysql> create table dt(a decimal(4,1));
> Query OK, 0 rows affected (0.01 sec)
>
> mysql> insert into dt set a=999.1;
> Query OK, 1 row affected (0.00 sec)
>
> mysql> alter table dt change a a decimal(2,1);
> Query OK, 1 row affected, 1 warning (0.02 sec)
> Records: 1  Duplicates: 0  Warnings: 1
>
> mysql> show warnings;
> +---------+------+-----------------------------------------------------+
> | Level   | Code | Message                                             |
> +---------+------+-----------------------------------------------------+
> | Warning | 1264 | Out of range value adjusted for column 'a' at row 1 |
> +---------+------+-----------------------------------------------------+

Could be me ... but isn't this a little too late?

eg: AFTER you have lost your data?

IMO, it should raise an error UNLESS you force it to truncate the data.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to