summaryrefslogtreecommitdiff
path: root/mysql-test/t/strict.test
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
commitd7453fec74f9025a75cc78a288997a74efabd97c (patch)
tree4ff40f4239fbd787fa231b72d868fed42d9562e3 /mysql-test/t/strict.test
parentfba3d8fa77d67e25c1d4e1cf8450a268ec1b220d (diff)
downloadmariadb-git-d7453fec74f9025a75cc78a288997a74efabd97c.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/t/strict.test')
-rw-r--r--mysql-test/t/strict.test27
1 files changed, 25 insertions, 2 deletions
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index d3928a623f4..8af0d632f7c 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -868,12 +868,12 @@ CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
--error 1406
INSERT INTO t1 (col1) VALUES ('hellobob');
---error 1265
+--error 1406
INSERT INTO t1 (col2) VALUES ('hellobob');
INSERT INTO t1 (col2) VALUES ('hello ');
--error 1406
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
---error 1265
+--error 1406
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
UPDATE IGNORE t1 SET col2 ='hellotrudy' WHERE col2 ='he';
@@ -939,3 +939,26 @@ INSERT IGNORE INTO t1 (col1) values (3);
INSERT IGNORE INTO t1 () values ();
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug #9029 Traditional: Wrong SQLSTATE returned for string truncation
+#
+
+set sql_mode='traditional';
+create table t1 (charcol char(255), varcharcol varchar(255),
+binarycol binary(255), varbinarycol varbinary(255), tinytextcol tinytext,
+tinyblobcol tinyblob);
+--error 1406
+insert into t1 (charcol) values (repeat('x',256));
+--error 1406
+insert into t1 (varcharcol) values (repeat('x',256));
+--error 1406
+insert into t1 (binarycol) values (repeat('x',256));
+--error 1406
+insert into t1 (varbinarycol) values (repeat('x',256));
+--error 1406
+insert into t1 (tinytextcol) values (repeat('x',256));
+--error 1406
+insert into t1 (tinyblobcol) values (repeat('x',256));
+select * from t1;
+drop table t1;