MySQL Forums
Forum List  »  Quality Assurance

Re: Regarding Error code : 1406 : Data Truncation : Data too long for column
Posted by: John Embretsen
Date: April 29, 2013 12:31PM

Sounds strange if you execute the commands one by one, and each command inserts only one row. Please specify more details if this is not correct. Please also specify your MySQL version.

Could it be that you are using a non-transactional storage engine such as MyISAM, and sql_mode is set to a strict mode, and you are inserting more than one row at a time?

This has some special behavior according to the documentation:

"For nontransactional tables, the behavior is the same for either mode, if the bad value occurs in the first row to be inserted or updated. The statement is aborted and the table remains unchanged. If the statement inserts or modifies multiple rows and the bad value occurs in the second or later row, the result depends on which strict option is enabled..."

see

http://dev.mysql.com/doc/refman/5.6/en/server-sql-mode.html#sqlmode_strict_all_tables

To check your sql_mode, do:

SELECT @@sql_mode;

To check the storage engine, do

SHOW CREATE TABLE <table_name>;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Regarding Error code : 1406 : Data Truncation : Data too long for column
9419
April 29, 2013 12:31PM


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.