Loading mysql-test/r/strict.result +2 −2 Original line number Diff line number Diff line Loading @@ -814,14 +814,14 @@ DROP TABLE t1; CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); INSERT INTO t1 (col1) VALUES ('hellobob'); ERROR 01000: Data truncated for column 'col1' at row 1 ERROR 22001: Data too long for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES ('hellobob'); ERROR 01000: Data truncated for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES ('hello '); Warnings: Note 1265 Data truncated for column 'col2' at row 1 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; ERROR 01000: Data truncated for column 'col1' at row 2 ERROR 22001: Data too long for column 'col1' at row 2 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; ERROR 01000: Data truncated for column 'col2' at row 2 INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob'); Loading mysql-test/t/strict.test +2 −2 Original line number Diff line number Diff line Loading @@ -565,12 +565,12 @@ DROP TABLE t1; CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); --error 1265 --error 1400 INSERT INTO t1 (col1) VALUES ('hellobob'); --error 1265 INSERT INTO t1 (col2) VALUES ('hellobob'); INSERT INTO t1 (col2) VALUES ('hello '); --error 1265 --error 1400 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; --error 1265 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; Loading sql/field.cc +6 −2 Original line number Diff line number Diff line Loading @@ -4370,8 +4370,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) error= 1; } if (error) { if (table->in_use->abort_on_warning) set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); else set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } return error; } Loading sql/share/errmsg.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5210,3 +5210,5 @@ ER_PROC_AUTO_GRANT_FAIL eng "Failed to grant EXECUTE and ALTER ROUTINE privileges" ER_PROC_AUTO_REVOKE_FAIL eng "Failed to revoke all privileges to dropped routine" ER_DATA_TOO_LONG 22001 eng "Data too long for column '%s' at row %ld" Loading
mysql-test/r/strict.result +2 −2 Original line number Diff line number Diff line Loading @@ -814,14 +814,14 @@ DROP TABLE t1; CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); INSERT INTO t1 (col1) VALUES ('hellobob'); ERROR 01000: Data truncated for column 'col1' at row 1 ERROR 22001: Data too long for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES ('hellobob'); ERROR 01000: Data truncated for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES ('hello '); Warnings: Note 1265 Data truncated for column 'col2' at row 1 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; ERROR 01000: Data truncated for column 'col1' at row 2 ERROR 22001: Data too long for column 'col1' at row 2 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; ERROR 01000: Data truncated for column 'col2' at row 2 INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob'); Loading
mysql-test/t/strict.test +2 −2 Original line number Diff line number Diff line Loading @@ -565,12 +565,12 @@ DROP TABLE t1; CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6)); INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello '); --error 1265 --error 1400 INSERT INTO t1 (col1) VALUES ('hellobob'); --error 1265 INSERT INTO t1 (col2) VALUES ('hellobob'); INSERT INTO t1 (col2) VALUES ('hello '); --error 1265 --error 1400 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he'; --error 1265 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he'; Loading
sql/field.cc +6 −2 Original line number Diff line number Diff line Loading @@ -4370,8 +4370,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) error= 1; } if (error) { if (table->in_use->abort_on_warning) set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1); else set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); } return error; } Loading
sql/share/errmsg.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5210,3 +5210,5 @@ ER_PROC_AUTO_GRANT_FAIL eng "Failed to grant EXECUTE and ALTER ROUTINE privileges" ER_PROC_AUTO_REVOKE_FAIL eng "Failed to revoke all privileges to dropped routine" ER_DATA_TOO_LONG 22001 eng "Data too long for column '%s' at row %ld"