summaryrefslogtreecommitdiff
path: root/mysql-test/t/type_blob.test
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-11-19 21:34:21 +0400
committerunknown <gshchepa/uchum@gleb.loc>2007-11-19 21:34:21 +0400
commitea739898281a86c074275f2f0a084840d7ed3e44 (patch)
tree9db47a6ebc5ed1c5edd36bbde3240226cfed3a47 /mysql-test/t/type_blob.test
parentac0612f5599a8a0038dcf4031a85e92b67bac1d0 (diff)
downloadmariadb-git-ea739898281a86c074275f2f0a084840d7ed3e44.tar.gz
Fixed bug #32282: TEXT silently truncates when value is exactly 65536
bytes length. The server has been modified to report warnings on truncation to 65536 bytes as usual. sql/sql_string.cc: Fixed bug #32282. The well_formed_copy_nchars function returned an incorrect value of copied bytes of the truncated input string: extra length of the first truncated character added to the *from_end_pos pointer. That has been fixed. mysql-test/r/type_blob.result: Added test case for bug #32282. mysql-test/t/type_blob.test: Added test case for bug #32282.
Diffstat (limited to 'mysql-test/t/type_blob.test')
-rw-r--r--mysql-test/t/type_blob.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index ba9f374a24c..d79b749dd65 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -436,4 +436,15 @@ set @@sql_mode='TRADITIONAL';
create table t1 (a text default '');
set @@sql_mode='';
+#
+# Bug #32282: TEXT silently truncates when value is exactly 65536 bytes
+#
+
+CREATE TABLE t (c TEXT CHARSET ASCII);
+INSERT INTO t (c) VALUES (REPEAT('1',65537));
+INSERT INTO t (c) VALUES (REPEAT('2',65536));
+INSERT INTO t (c) VALUES (REPEAT('3',65535));
+SELECT LENGTH(c), CHAR_LENGTH(c) FROM t;
+DROP TABLE t;
+
--echo End of 5.0 tests