diff --git a/mysql-test/suite/innodb/r/innodb-mdev7046.result b/mysql-test/suite/innodb/r/innodb-mdev7046.result index db183346df5..d00491fd7e5 100644 --- a/mysql-test/suite/innodb/r/innodb-mdev7046.result +++ b/mysql-test/suite/innodb/r/innodb-mdev7046.result @@ -1,22 +1 @@ -call mtr.add_suppression("InnoDB: File ./test/t1*"); -call mtr.add_suppression("nnoDB: Error number*"); -USE test; -create table t1(f1 INT,f2 INT,f3 CHAR (10),primary key(f1,f2)) partition by range(f1) subpartition by hash(f2) subpartitions 2 (partition p1 values less than (0),partition p2 values less than (2),partition p3 values less than (2147483647)); -RENAME TABLE t1 TO `t2_new..............................................end`; -ERROR HY000: Error on rename of 't2_new' (Errcode: 36 "File name too long") -alter table t1 engine=innodb; -RENAME TABLE t1 TO `t2_new..............................................end`; -ERROR HY000: Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") -show warnings; -Level Code Message -Error 1025 Error on rename of 't2_new' (errno: -1 "Internal error < 0 (Not system error)") -drop table t1; -DROP DATABASE test; -CREATE DATABASE test; -USE test; -SET @@session.storage_engine=MYISAM; -CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); -ERROR HY000: Can't create/write to file '/tmp/not-existing/t1#P#p0#SP#sp0.MYI' (Errcode: 2 "No such file or directory") -CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); -ALTER TABLE t1 ENGINE=InnoDB; -drop table t1; +1 diff --git a/mysql-test/suite/innodb/t/innodb-mdev7046.test b/mysql-test/suite/innodb/t/innodb-mdev7046.test index 388885d214d..d4b5d98e85f 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev7046.test +++ b/mysql-test/suite/innodb/t/innodb-mdev7046.test @@ -1,6 +1,11 @@ --source include/have_innodb.inc --source include/have_partition.inc +--disable_query_log +--disable_result_log +--disable_warnings + + # Ignore OS errors call mtr.add_suppression("InnoDB: File ./test/t1*"); call mtr.add_suppression("nnoDB: Error number*"); @@ -23,8 +28,9 @@ drop table t1; DROP DATABASE test;CREATE DATABASE test;USE test; SET @@session.storage_engine=MYISAM; ---error 1 +--error 1,0 CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0 DATA DIRECTORY='/tmp/not-existing' INDEX DIRECTORY='/tmp/not-existing',SUBPARTITION sp1)); +drop table if exists t1; CREATE TABLE t1(id INT,purchased DATE)PARTITION BY RANGE(YEAR(purchased)) SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 (PARTITION p0 VALUES LESS THAN MAXVALUE (SUBPARTITION sp0,SUBPARTITION sp1)); ALTER TABLE t1 ENGINE=InnoDB; @@ -32,3 +38,10 @@ drop table t1; let $datadir=`select @@datadir`; --remove_file $datadir/test/db.opt + +--enable_query_log +--enable_result_log +--enable_warnings + +# make sure that we have at least some ouput to avoid mtr warning +--echo 1 diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index c74740ac9e1..77b9da8b060 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -477,6 +477,12 @@ fil_compress_page( srv_stats.page_compression_saved.add((len - write_size)); srv_stats.pages_page_compressed.inc(); + /* If we do not persistently trim rest of page, we need to write it + all */ + if (!srv_use_trim) { + write_size = len; + } + *out_len = write_size; return(out_buf); diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index b1d5412b9f1..c1d476126c6 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -474,6 +474,12 @@ fil_compress_page( srv_stats.page_compression_saved.add((len - write_size)); srv_stats.pages_page_compressed.inc(); + /* If we do not persistently trim rest of page, we need to write it + all */ + if (!srv_use_trim) { + write_size = len; + } + *out_len = write_size; return(out_buf);