summaryrefslogtreecommitdiff
path: root/mysql-test/r/strict.result
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2005-03-10 17:08:45 +0400
committerunknown <ramil@mysql.com>2005-03-10 17:08:45 +0400
commit1690bab938e46f5a8c018c05c17c88d4076b3b8b (patch)
tree4ff40f4239fbd787fa231b72d868fed42d9562e3 /mysql-test/r/strict.result
parent83fa3560bc13734b2d92c84064d836fd2e05bc8d (diff)
downloadmariadb-git-1690bab938e46f5a8c018c05c17c88d4076b3b8b.tar.gz
a fix (bug #9029 Traditional: Wrong SQLSTATE returned for string truncation).
sql/field.cc: a fix (bug #9029 Traditional: Wrong SQLSTATE returned for string truncation). Should issue ER_DATA_TOO_LONG in 'traditional' mode when data truncated.
Diffstat (limited to 'mysql-test/r/strict.result')
-rw-r--r--mysql-test/r/strict.result23
1 files changed, 21 insertions, 2 deletions
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index c28ea0fce02..18680b0f5a6 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -906,14 +906,14 @@ INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
INSERT INTO t1 (col1) VALUES ('hellobob');
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
+ERROR 22001: Data too long 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 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
+ERROR 22001: Data too long for column 'col2' at row 2
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
@@ -1011,3 +1011,22 @@ col1 col2
3
99
DROP TABLE t1;
+set sql_mode='traditional';
+create table t1 (charcol char(255), varcharcol varchar(255),
+binarycol binary(255), varbinarycol varbinary(255), tinytextcol tinytext,
+tinyblobcol tinyblob);
+insert into t1 (charcol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'charcol' at row 1
+insert into t1 (varcharcol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'varcharcol' at row 1
+insert into t1 (binarycol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'binarycol' at row 1
+insert into t1 (varbinarycol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'varbinarycol' at row 1
+insert into t1 (tinytextcol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'tinytextcol' at row 1
+insert into t1 (tinyblobcol) values (repeat('x',256));
+ERROR 22001: Data too long for column 'tinyblobcol' at row 1
+select * from t1;
+charcol varcharcol binarycol varbinarycol tinytextcol tinyblobcol
+drop table t1;