MySQL Forums
Forum List  »  InnoDB

Data truncation in modified character columns
Posted by: Peter Melvyn
Date: May 03, 2008 01:44AM

Hi all.

please, is anybody out there who could shed light on data truncation? It seems to me a little bit mystic...
If I've tried to alter CHAR and VARCHAR columns (UTF-8, not indexed) and got different results on different types of truncation:

CHAR(x) -> CHAR(y), y < x: Error 1265: Data Truncated for ..., no schema change
CHAR(x) -> VARCHAR(y), y < x: Error 1406: Data too long for ..., no schema change
VARCHAR(x) -> CHAR(y), y < x: Error 1406: Data too long for ..., no schema change
VARCHAR(x) -> VARCHAR(y):
2 < y < x: No Erros, schema changed, no data truncation
2 >= y < x: Error 1265: Data Truncated for ..., no schema change

I have MySQL Community server 5.0.37 on Windows 2KSP4

Thanks, Peter



Edited 2 time(s). Last edit at 05/03/2008 04:47AM by Peter Melvyn.

Options: ReplyQuote


Subject
Views
Written By
Posted
Data truncation in modified character columns
2021
May 03, 2008 01:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.