summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/innodb_blob_truncate.test
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-11-05 09:42:23 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2015-11-05 10:30:48 +0200
commit25f8738112b05f33cfa45eabfebf6edfc80e6d8a (patch)
treed712ae201455bdefc223d22717c11bcd01000a8a /mysql-test/suite/innodb/t/innodb_blob_truncate.test
parentf9e320c82daec5acc21884c2b09a139e19632c45 (diff)
downloadmariadb-git-25f8738112b05f33cfa45eabfebf6edfc80e6d8a.tar.gz
MDEV-9040: 10.1.8 fails after upgrade from 10.0.21
Analysis: Lengths which are not UNIV_SQL_NULL, but bigger than the following number indicate that a field contains a reference to an externally stored part of the field in the tablespace. The length field then contains the sum of the following flag and the locally stored len. This was incorrectly set to define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX) When it should be define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_DEF) Additionally, we need to disable support for > 16K page size for row compressed tables because a compressed page directory entry reserves 14 bits for the start offset and 2 bits for flags. This limits the uncompressed page size to 16k. To support larger pages page directory entry needs to be larger.
Diffstat (limited to 'mysql-test/suite/innodb/t/innodb_blob_truncate.test')
-rw-r--r--mysql-test/suite/innodb/t/innodb_blob_truncate.test45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/innodb_blob_truncate.test b/mysql-test/suite/innodb/t/innodb_blob_truncate.test
new file mode 100644
index 00000000000..8a4248c795e
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_blob_truncate.test
@@ -0,0 +1,45 @@
+--source include/have_innodb.inc
+--source include/have_innodb_16k.inc
+
+--disable_query_log
+let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
+let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
+--enable_query_log
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+create table t1(a blob) engine=innodb key_block_size=8;
+delimiter //;
+create function generate_blob()
+ returns varchar(20000)
+ begin
+ declare x varchar(20000) default '';
+ declare i int default 500;
+ while i > 0 do
+ set x = concat(sha1(i), x);
+ set i = i - 1;
+ end while;
+ return x;
+end //
+delimiter ;//
+insert into t1 select generate_blob();
+let $x = `select 20000 - length(a) from t1`;
+if ($x) {
+ echo Blob is truncated by $x bytes.;
+ die It must have been 20000 bytes.;
+}
+truncate t1;
+insert into t1 select generate_blob();
+let $x = `select 20000 - length(a) from t1`;
+if ($x) {
+ echo Blob is truncated by $x bytes.;
+ die It must have been 20000 bytes.;
+}
+drop table t1;
+drop function generate_blob;
+
+--disable_query_log
+EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
+EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
+--enable_query_log