diff options
34 files changed, 1651 insertions, 82 deletions
diff --git a/config.h.cmake b/config.h.cmake index 8982976a0bd..c575f13a62d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -94,6 +94,7 @@ #cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_SYS_UN_H 1 #cmakedefine HAVE_SYS_VADVISE_H 1 +#cmakedefine HAVE_SYS_STATVFS_H 1 #cmakedefine HAVE_TERM_H 1 #cmakedefine HAVE_TERMBITS_H 1 #cmakedefine HAVE_TERMIOS_H 1 diff --git a/configure.cmake b/configure.cmake index d8b219f0e01..d5076dada02 100644 --- a/configure.cmake +++ b/configure.cmake @@ -260,6 +260,7 @@ CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H) CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H) +CHECK_INCLUDE_FILES (sys/statvfs.h HAVE_SYS_STATVFS_H) SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DPACKAGE=test) # bfd.h is picky CHECK_INCLUDE_FILES (bfd.h BFD_H_EXISTS) diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result index e954e60c9ae..8d3bc063a71 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result @@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( `c1` int(11) DEFAULT NULL, `b` char(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -211,6 +295,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -255,6 +381,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result index ec0e06fdfec..eeab2622cb6 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result @@ -167,6 +167,91 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( `c1` int(11) DEFAULT NULL, `b` char(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +commit; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -211,6 +296,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -255,6 +382,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result index 1bb1164afa6..d340801b656 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result @@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( `c1` int(11) DEFAULT NULL, `b` char(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -211,6 +295,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -255,6 +381,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result index e2655a3e581..fdbc99f60d9 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result @@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( `c1` int(11) DEFAULT NULL, `b` char(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -211,6 +295,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result index 2baf15bacad..4c3ab273b2e 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_zip.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result @@ -167,6 +167,90 @@ innodb_compressed CREATE TABLE `innodb_compressed` ( `c1` int(11) DEFAULT NULL, `b` char(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; update innodb_page_compressed2 set c1 = c1 + 1; @@ -211,6 +295,48 @@ count(*) select count(*) from innodb_page_compressed9 where c1 < 500000; count(*) 5000 +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +count(*) +5000 +select count(*) from innodb_page_compressed1; +count(*) +5000 +select count(*) from innodb_page_compressed1 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed2 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed3 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed4 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed5 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed6 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed7 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed8 where c1 < 500000; +count(*) +5000 +select count(*) from innodb_page_compressed9 where c1 < 500000; +count(*) +5000 drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test index e5eafe331ee..2e8831151c7 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test @@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress show warnings; show create table innodb_compressed; +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + # zlib set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; @@ -116,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + # none set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; @@ -140,6 +207,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test index df045b241dc..731cbdeab66 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test @@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress show warnings; show create table innodb_compressed; +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +commit; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; # zlib set global innodb_compression_algorithm = 1; @@ -117,6 +161,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + # none set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; @@ -141,6 +208,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test index 80169008fee..071e86b0f9b 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test @@ -92,6 +92,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress show warnings; show create table innodb_compressed; +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; # zlib set global innodb_compression_algorithm = 1; @@ -117,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + # none set global innodb_compression_algorithm = 0; update innodb_page_compressed1 set c1 = c1 + 1; @@ -141,6 +207,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test index bce06a025dd..6a73f793f26 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test @@ -92,6 +92,50 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress show warnings; show create table innodb_compressed; +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + # zlib set global innodb_compression_algorithm = 1; update innodb_page_compressed1 set c1 = c1 + 1; @@ -116,6 +160,29 @@ select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compressed; diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test index cd28e5959bc..8d06367e9b2 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test @@ -91,6 +91,49 @@ alter table innodb_compressed row_format=default page_compressed=1 page_compress show warnings; show create table innodb_compressed; +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; + +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; # none set global innodb_compression_algorithm = 0; @@ -115,6 +158,28 @@ select count(*) from innodb_page_compressed6 where c1 < 500000; select count(*) from innodb_page_compressed7 where c1 < 500000; select count(*) from innodb_page_compressed8 where c1 < 500000; select count(*) from innodb_page_compressed9 where c1 < 500000; +--source include/restart_mysqld.inc + +update innodb_page_compressed1 set c1 = c1 + 1; +update innodb_page_compressed2 set c1 = c1 + 1; +update innodb_page_compressed3 set c1 = c1 + 1; +update innodb_page_compressed4 set c1 = c1 + 1; +update innodb_page_compressed5 set c1 = c1 + 1; +update innodb_page_compressed6 set c1 = c1 + 1; +update innodb_page_compressed7 set c1 = c1 + 1; +update innodb_page_compressed8 set c1 = c1 + 1; +update innodb_page_compressed9 set c1 = c1 + 1; +select count(*) from innodb_compressed; +select count(*) from innodb_page_compressed1; +select count(*) from innodb_page_compressed1 where c1 < 500000; +select count(*) from innodb_page_compressed2 where c1 < 500000; +select count(*) from innodb_page_compressed3 where c1 < 500000; +select count(*) from innodb_page_compressed4 where c1 < 500000; +select count(*) from innodb_page_compressed5 where c1 < 500000; +select count(*) from innodb_page_compressed6 where c1 < 500000; +select count(*) from innodb_page_compressed7 where c1 < 500000; +select count(*) from innodb_page_compressed8 where c1 < 500000; +select count(*) from innodb_page_compressed9 where c1 < 500000; drop procedure innodb_insert_proc; drop table innodb_normal; diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result index aee118aced2..a20647487f5 100644 --- a/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result @@ -164,7 +164,12 @@ compression_pad_increments disabled compression_pad_decrements disabled compress_saved disabled compress_trim_sect512 disabled +compress_trim_sect1024 disabled +compress_trim_sect2048 disabled compress_trim_sect4096 disabled +compress_trim_sect8192 disabled +compress_trim_sect16384 disabled +compress_trim_sect32768 disabled compress_pages_page_compressed disabled compress_page_compressed_trim_op disabled compress_page_compressed_trim_op_saved disabled diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result index aee118aced2..a20647487f5 100644 --- a/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result @@ -164,7 +164,12 @@ compression_pad_increments disabled compression_pad_decrements disabled compress_saved disabled compress_trim_sect512 disabled +compress_trim_sect1024 disabled +compress_trim_sect2048 disabled compress_trim_sect4096 disabled +compress_trim_sect8192 disabled +compress_trim_sect16384 disabled +compress_trim_sect32768 disabled compress_pages_page_compressed disabled compress_page_compressed_trim_op disabled compress_page_compressed_trim_op_saved disabled diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result index aee118aced2..a20647487f5 100644 --- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result @@ -164,7 +164,12 @@ compression_pad_increments disabled compression_pad_decrements disabled compress_saved disabled compress_trim_sect512 disabled +compress_trim_sect1024 disabled +compress_trim_sect2048 disabled compress_trim_sect4096 disabled +compress_trim_sect8192 disabled +compress_trim_sect16384 disabled +compress_trim_sect32768 disabled compress_pages_page_compressed disabled compress_page_compressed_trim_op disabled compress_page_compressed_trim_op_saved disabled diff --git a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result index aee118aced2..a20647487f5 100644 --- a/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result @@ -164,7 +164,12 @@ compression_pad_increments disabled compression_pad_decrements disabled compress_saved disabled compress_trim_sect512 disabled +compress_trim_sect1024 disabled +compress_trim_sect2048 disabled compress_trim_sect4096 disabled +compress_trim_sect8192 disabled +compress_trim_sect16384 disabled +compress_trim_sect32768 disabled compress_pages_page_compressed disabled compress_page_compressed_trim_op disabled compress_page_compressed_trim_op_saved disabled diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 93245f9c0e1..edd914cd317 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2014 SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2014, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -181,6 +181,7 @@ struct fil_node_t { ib_int64_t flush_counter;/*!< up to what modification_counter value we have flushed the modifications to disk */ + ulint file_block_size;/*!< file system block size */ UT_LIST_NODE_T(fil_node_t) chain; /*!< link field for the file chain */ UT_LIST_NODE_T(fil_node_t) LRU; @@ -778,6 +779,8 @@ fil_node_open_file( size_bytes = os_file_get_size(node->handle); ut_a(size_bytes != (os_offset_t) -1); + + node->file_block_size = os_file_get_block_size(node->handle, node->name); #ifdef UNIV_HOTBACKUP if (space->id == 0) { node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); @@ -927,6 +930,10 @@ add_size: &ret, atomic_writes); } + if (node->file_block_size == 0) { + node->file_block_size = os_file_get_block_size(node->handle, node->name); + } + ut_a(ret); node->open = TRUE; @@ -5185,6 +5192,11 @@ retry: start_page_no = space->size; file_start_page_no = space->size - node->size; + /* Determine correct file block size */ + if (node->file_block_size == 0) { + node->file_block_size = os_file_get_block_size(node->handle, node->name); + } + #ifdef HAVE_POSIX_FALLOCATE if (srv_use_posix_fallocate) { os_offset_t start_offset = start_page_no * page_size; @@ -6721,36 +6733,47 @@ fil_get_page_type_name( { switch(page_type) { case FIL_PAGE_PAGE_COMPRESSED: - return "PAGE_COMPRESSED"; + return (const char*)"PAGE_COMPRESSED"; case FIL_PAGE_INDEX: - return "INDEX"; + return (const char*)"INDEX"; case FIL_PAGE_UNDO_LOG: - return "UNDO LOG"; + return (const char*)"UNDO LOG"; case FIL_PAGE_INODE: - return "INODE"; + return (const char*)"INODE"; case FIL_PAGE_IBUF_FREE_LIST: - return "IBUF_FREE_LIST"; + return (const char*)"IBUF_FREE_LIST"; case FIL_PAGE_TYPE_ALLOCATED: - return "ALLOCATED"; + return (const char*)"ALLOCATED"; case FIL_PAGE_IBUF_BITMAP: - return "IBUF_BITMAP"; + return (const char*)"IBUF_BITMAP"; case FIL_PAGE_TYPE_SYS: - return "SYS"; + return (const char*)"SYS"; case FIL_PAGE_TYPE_TRX_SYS: - return "TRX_SYS"; + return (const char*)"TRX_SYS"; case FIL_PAGE_TYPE_FSP_HDR: - return "FSP_HDR"; + return (const char*)"FSP_HDR"; case FIL_PAGE_TYPE_XDES: - return "XDES"; + return (const char*)"XDES"; case FIL_PAGE_TYPE_BLOB: - return "BLOB"; + return (const char*)"BLOB"; case FIL_PAGE_TYPE_ZBLOB: - return "ZBLOB"; + return (const char*)"ZBLOB"; case FIL_PAGE_TYPE_ZBLOB2: - return "ZBLOB2"; + return (const char*)"ZBLOB2"; case FIL_PAGE_TYPE_COMPRESSED: - return "ORACLE PAGE COMPRESSED"; + return (const char*)"ORACLE PAGE COMPRESSED"; default: - return "PAGE TYPE CORRUPTED"; + return (const char*)"PAGE TYPE CORRUPTED"; } } +/****************************************************************//** +Get block size from fil node +@return block size*/ +ulint +fil_node_get_block_size( +/*====================*/ + fil_node_t* node) /*!< in: Node where to get block + size */ +{ + return (node->file_block_size); +} diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc index 77efd250fa0..68a7163897f 100644 --- a/storage/innobase/fil/fil0pagecompress.cc +++ b/storage/innobase/fil/fil0pagecompress.cc @@ -260,6 +260,7 @@ fil_compress_page( byte* out_buf, /*!< out: compressed buffer */ ulint len, /*!< in: length of input buffer.*/ ulint compression_level, /* in: compression level */ + ulint block_size, /*!< in: block size */ ulint* out_len, /*!< out: actual length of compressed page */ byte* lzo_mem) /*!< in: temporal memory used by LZO */ @@ -453,12 +454,11 @@ fil_compress_page( write_size+=header_len; -#define SECT_SIZE 512 - /* Actual write needs to be alligned on block size */ - if (write_size % SECT_SIZE) { - write_size = (write_size + SECT_SIZE-1) & ~(SECT_SIZE-1); - ut_a((write_size % SECT_SIZE) == 0); + if (write_size % block_size) { + ut_a(block_size > 0); + write_size = (write_size + block_size-1) & ~(block_size-1); + ut_a((write_size % block_size) == 0); } #ifdef UNIV_PAGECOMPRESS_DEBUG diff --git a/storage/innobase/include/fil0pagecompress.h b/storage/innobase/include/fil0pagecompress.h index 395a158b8f7..fb97af87460 100644 --- a/storage/innobase/include/fil0pagecompress.h +++ b/storage/innobase/include/fil0pagecompress.h @@ -93,6 +93,7 @@ fil_compress_page( byte* out_buf, /*!< out: compressed buffer */ ulint len, /*!< in: length of input buffer.*/ ulint compression_level, /*!< in: compression level */ + ulint block_size, /*!< in: block size */ ulint* out_len, /*!< out: actual length of compressed page */ byte* lzo_mem); /*!< in: temporal memory used by LZO */ @@ -117,8 +118,15 @@ Get space id from fil node ulint fil_node_get_space_id( /*==================*/ - fil_node_t* node); /*!< in: Node where to get space id*/ + fil_node_t* node); /*!< in: Node where to get space id*/ +/****************************************************************//** +Get block size from fil node +@return block size*/ +ulint +fil_node_get_block_size( + fil_node_t* node); /*!< in: Node where to get block + size */ /*******************************************************************//** Find out wheather the page is page compressed @return true if page is page compressed*/ diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 15f4f0235b5..e82ef17f718 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -1333,6 +1333,16 @@ os_file_handle_error_no_exit( const char* file, /*!< in: file name */ const ulint line); /*!< in: line */ +/***********************************************************************//** +Try to get number of bytes per sector from file system. +@return file block size */ +UNIV_INTERN +ulint +os_file_get_block_size( +/*===================*/ + os_file_t file, /*!< in: handle to a file */ + const char* name); /*!< in: file name */ + #ifndef UNIV_NONINL #include "os0file.ic" #endif diff --git a/storage/innobase/include/srv0mon.h b/storage/innobase/include/srv0mon.h index 2b02428bfb6..dccf2d99bb0 100644 --- a/storage/innobase/include/srv0mon.h +++ b/storage/innobase/include/srv0mon.h @@ -310,7 +310,12 @@ enum monitor_id_t { /* New monitor variables for page compression */ MONITOR_OVLD_PAGE_COMPRESS_SAVED, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768, MONITOR_OVLD_PAGES_PAGE_COMPRESSED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 6844d0fd0c6..7ba69736271 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -107,8 +107,18 @@ struct srv_stats_t { ulint_ctr_64_t page_compression_saved; /** Number of 512Byte TRIM by page compression */ ulint_ctr_64_t page_compression_trim_sect512; + /** Number of 1K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect1024; + /** Number of 2K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect2048; /** Number of 4K TRIM by page compression */ ulint_ctr_64_t page_compression_trim_sect4096; + /** Number of 8K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect8192; + /** Number of 16K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect16384; + /** Number of 32K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect32768; /* Number of index pages written */ ulint_ctr_64_t index_pages_written; /* Number of non index pages written */ @@ -930,8 +940,18 @@ struct export_var_t{ by page compression */ ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM by page compression */ + ib_int64_t innodb_page_compression_trim_sect1024;/*!< Number of 1K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect2048;/*!< Number of 2K TRIM + by page compression */ ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM by page compression */ + ib_int64_t innodb_page_compression_trim_sect8192;/*!< Number of 8K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect16384;/*!< Number of 16K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect32768;/*!< Number of 32K TRIM + by page compression */ ib_int64_t innodb_index_pages_written; /*!< Number of index pages written */ ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 0fc5d1c047b..68e024b3481 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2014, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -73,6 +73,10 @@ Created 10/21/1995 Heikki Tuuri # endif #endif +#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H) +#include <sys/statvfs.h> +#endif + #ifdef HAVE_LZO #include "lzo/lzo1x.h" #endif @@ -219,6 +223,10 @@ struct os_aio_slot_t{ free this */ ibool page_compress_success; + /*!< TRUE if page compression was + successfull, false if not */ + + ulint file_block_size;/*!< file block size */ #ifdef WIN_ASYNC_IO HANDLE handle; /*!< handle object we need in the @@ -354,9 +362,7 @@ UNIV_INTERN ibool os_file_trim( /*=========*/ - os_file_t file, /*!< in: file to be trimmed */ - os_aio_slot_t* slot, /*!< in: slot structure */ - ulint len); /*!< in: length of area */ + os_aio_slot_t* slot); /*!< in: slot structure */ /**********************************************************************//** Allocate memory for temporal buffer used for page compression. This @@ -4612,6 +4618,7 @@ found: slot->write_size = write_size; slot->page_compression_level = page_compression_level; slot->page_compression = page_compression; + slot->file_block_size = fil_node_get_block_size(message1); /* If the space is page compressed and this is write operation then we compress the page */ @@ -4640,6 +4647,7 @@ found: slot->page_buf, len, page_compression_level, + fil_node_get_block_size(slot->message1), &real_len, slot->lzo_mem ); @@ -5344,7 +5352,7 @@ os_aio_windows_handle( if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) { if (srv_use_trim && os_fallocate_failed == FALSE) { // Deallocate unused blocks from file system - os_file_trim(slot->file, slot, slot->len); + os_file_trim(slot); } } } @@ -5463,7 +5471,7 @@ retry: ut_ad(slot->page_compression_page); if (srv_use_trim && os_fallocate_failed == FALSE) { // Deallocate unused blocks from file system - os_file_trim(slot->file, slot, slot->len); + os_file_trim(slot); } } } @@ -6332,17 +6340,18 @@ UNIV_INTERN ibool os_file_trim( /*=========*/ - os_file_t file, /*!< in: file to be trimmed */ - os_aio_slot_t* slot, /*!< in: slot structure */ - ulint len) /*!< in: length of area */ + os_aio_slot_t* slot) /*!< in: slot structure */ { -#define SECT_SIZE 512 + size_t len = slot->len; size_t trim_len = UNIV_PAGE_SIZE - len; os_offset_t off = slot->offset + len; + size_t bsize = slot->file_block_size; + // len here should be alligned to sector size - ut_a((trim_len % SECT_SIZE) == 0); - ut_a((len % SECT_SIZE) == 0); + ut_ad((trim_len % bsize) == 0); + ut_ad((len % bsize) == 0); + ut_ad(bsize != 0); // Nothing to do if trim length is zero or if actual write // size is initialized and it is smaller than current write size. @@ -6372,7 +6381,7 @@ os_file_trim( #ifdef __linux__ #if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE) - int ret = fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); + int ret = fallocate(slot->file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); if (ret) { /* After first failure do not try to trim again */ @@ -6416,7 +6425,8 @@ os_file_trim( flt.Ranges[0].Offset = off; flt.Ranges[0].Length = trim_len; - BOOL ret = DeviceIoControl(file,FSCTL_FILE_LEVEL_TRIM,&flt, sizeof(flt), NULL, NULL, NULL, NULL); + BOOL ret = DeviceIoControl(slot->file, FSCTL_FILE_LEVEL_TRIM, + &flt, sizeof(flt), NULL, NULL, NULL, NULL); if (!ret) { /* After first failure do not try to trim again */ @@ -6442,8 +6452,32 @@ os_file_trim( } #endif - srv_stats.page_compression_trim_sect512.add((trim_len / SECT_SIZE)); - srv_stats.page_compression_trim_sect4096.add((trim_len / (SECT_SIZE*8))); + switch(bsize) { + case 512: + srv_stats.page_compression_trim_sect512.add((trim_len / bsize)); + break; + case 1024: + srv_stats.page_compression_trim_sect1024.add((trim_len / bsize)); + break; + case 2948: + srv_stats.page_compression_trim_sect2048.add((trim_len / bsize)); + break; + case 4096: + srv_stats.page_compression_trim_sect4096.add((trim_len / bsize)); + break; + case 8192: + srv_stats.page_compression_trim_sect8192.add((trim_len / bsize)); + break; + case 16384: + srv_stats.page_compression_trim_sect16384.add((trim_len / bsize)); + break; + case 32768: + srv_stats.page_compression_trim_sect32768.add((trim_len / bsize)); + break; + default: + break; + } + srv_stats.page_compressed_trim_op.inc(); return (TRUE); @@ -6487,3 +6521,57 @@ os_slot_alloc_lzo_mem( ut_a(slot->lzo_mem != NULL); } #endif + +/***********************************************************************//** +Try to get number of bytes per sector from file system. +@return file block size */ +UNIV_INTERN +ulint +os_file_get_block_size( +/*===================*/ + os_file_t file, /*!< in: handle to a file */ + const char* name) /*!< in: file name */ +{ + ulint fblock_size = 512; + +#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H) + struct statvfs fstat; + int err; + + err = fstatvfs(file, &fstat); + + if (err != 0) { + fprintf(stderr, "InnoDB: Warning: fstatvfs() failed on file %s\n", name); + os_file_handle_error_no_exit(name, "fstatvfs()", FALSE, __FILE__, __LINE__); + } else { + fblock_size = fstat.f_bsize; + } +#endif /* UNIV_LINUX */ +#ifdef __WIN__ + { + DWORD SectorsPerCluster = 0; + DWORD BytesPerSector = 0; + DWORD NumberOfFreeClusters = 0; + DWORD TotalNumberOfClusters = 0; + + if (GetFreeSpace((LPCTSTR)name, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters)) { + fblock_size = BytesPerSector; + fprintf(stderr, "InnoDB: [Note]: Using %ld file block size\n", fblock_size); + } else { + fprintf(stderr, "InnoDB: Warning: GetFreeSpace() failed on file %s\n", name); + os_file_handle_error_no_exit(name, "GetFreeSpace()", FALSE, __FILE__, __LINE__); + } + } +#endif /* __WIN__*/ + + if (fblock_size > UNIV_PAGE_SIZE/2) { + fprintf(stderr, "InnoDB: Warning: File system for file %s has " + "file block size %lu not supported for page_size %lu\n", + name, fblock_size, UNIV_PAGE_SIZE); + fblock_size = UNIV_PAGE_SIZE/2; + fprintf(stderr, "InnoDB: Note: Using file block size %ld for file %s\n", + fblock_size, name); + } + + return fblock_size; +} diff --git a/storage/innobase/os/os0sync.cc b/storage/innobase/os/os0sync.cc index e42c5900c0c..779152a3a56 100644 --- a/storage/innobase/os/os0sync.cc +++ b/storage/innobase/os/os0sync.cc @@ -686,7 +686,7 @@ os_event_wait_time_low( tv.tv_usec += time_in_usec; if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) { - tv.tv_sec += time_in_usec / MICROSECS_IN_A_SECOND; + tv.tv_sec += tv.tv_usec / MICROSECS_IN_A_SECOND; tv.tv_usec %= MICROSECS_IN_A_SECOND; } diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 5880e03073e..7be25966557 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -2,6 +2,7 @@ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2013, 2014, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] = MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512}, + {"compress_trim_sect1024", "compression", + "Number of sect-1024 TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024}, + + {"compress_trim_sect2048", "compression", + "Number of sect-2048 TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048}, + {"compress_trim_sect4096", "compression", "Number of sect-4K TRIMed by page compression", MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096}, + {"compress_trim_sect8192", "compression", + "Number of sect-8K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192}, + + {"compress_trim_sect16384", "compression", + "Number of sect-16K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384}, + + {"compress_trim_sect32768", "compression", + "Number of sect-32K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768}, + {"compress_pages_page_compressed", "compression", "Number of pages compressed by page compression", MONITOR_NONE, @@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter( case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512: value = srv_stats.page_compression_trim_sect512; break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024: + value = srv_stats.page_compression_trim_sect1024; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048: + value = srv_stats.page_compression_trim_sect2048; + break; case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096: value = srv_stats.page_compression_trim_sect4096; break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192: + value = srv_stats.page_compression_trim_sect8192; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384: + value = srv_stats.page_compression_trim_sect16384; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768: + value = srv_stats.page_compression_trim_sect32768; + break; case MONITOR_OVLD_PAGES_PAGE_COMPRESSED: value = srv_stats.pages_page_compressed; break; diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc index 31430368514..b5e1a63f62d 100644 --- a/storage/xtradb/fil/fil0fil.cc +++ b/storage/xtradb/fil/fil0fil.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2014, MariaDB Corporation. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -179,6 +179,7 @@ struct fil_node_t { ib_int64_t flush_counter;/*!< up to what modification_counter value we have flushed the modifications to disk */ + ulint file_block_size;/*!< file system block size */ UT_LIST_NODE_T(fil_node_t) chain; /*!< link field for the file chain */ UT_LIST_NODE_T(fil_node_t) LRU; @@ -779,6 +780,8 @@ fil_node_open_file( size_bytes = os_file_get_size(node->handle); ut_a(size_bytes != (os_offset_t) -1); + + node->file_block_size = os_file_get_block_size(node->handle, node->name); #ifdef UNIV_HOTBACKUP if (space->id == 0) { node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); @@ -927,6 +930,10 @@ add_size: &ret, atomic_writes); } + if (node->file_block_size == 0) { + node->file_block_size = os_file_get_block_size(node->handle, node->name); + } + ut_a(ret); node->open = TRUE; @@ -5221,6 +5228,11 @@ retry: start_page_no = space->size; file_start_page_no = space->size - node->size; + /* Determine correct file block size */ + if (node->file_block_size == 0) { + node->file_block_size = os_file_get_block_size(node->handle, node->name); + } + #ifdef HAVE_POSIX_FALLOCATE if (srv_use_posix_fallocate) { os_offset_t start_offset = start_page_no * page_size; @@ -6853,36 +6865,47 @@ fil_get_page_type_name( { switch(page_type) { case FIL_PAGE_PAGE_COMPRESSED: - return "PAGE_COMPRESSED"; + return (const char*)"PAGE_COMPRESSED"; case FIL_PAGE_INDEX: - return "INDEX"; + return (const char*)"INDEX"; case FIL_PAGE_UNDO_LOG: - return "UNDO LOG"; + return (const char*)"UNDO LOG"; case FIL_PAGE_INODE: - return "INODE"; + return (const char*)"INODE"; case FIL_PAGE_IBUF_FREE_LIST: - return "IBUF_FREE_LIST"; + return (const char*)"IBUF_FREE_LIST"; case FIL_PAGE_TYPE_ALLOCATED: - return "ALLOCATED"; + return (const char*)"ALLOCATED"; case FIL_PAGE_IBUF_BITMAP: - return "IBUF_BITMAP"; + return (const char*)"IBUF_BITMAP"; case FIL_PAGE_TYPE_SYS: - return "SYS"; + return (const char*)"SYS"; case FIL_PAGE_TYPE_TRX_SYS: - return "TRX_SYS"; + return (const char*)"TRX_SYS"; case FIL_PAGE_TYPE_FSP_HDR: - return "FSP_HDR"; + return (const char*)"FSP_HDR"; case FIL_PAGE_TYPE_XDES: - return "XDES"; + return (const char*)"XDES"; case FIL_PAGE_TYPE_BLOB: - return "BLOB"; + return (const char*)"BLOB"; case FIL_PAGE_TYPE_ZBLOB: - return "ZBLOB"; + return (const char*)"ZBLOB"; case FIL_PAGE_TYPE_ZBLOB2: - return "ZBLOB2"; + return (const char*)"ZBLOB2"; case FIL_PAGE_TYPE_COMPRESSED: - return "ORACLE PAGE COMPRESSED"; + return (const char*)"ORACLE PAGE COMPRESSED"; default: - return "PAGE TYPE CORRUPTED"; + return (const char*)"PAGE TYPE CORRUPTED"; } } +/****************************************************************//** +Get block size from fil node +@return block size*/ +ulint +fil_node_get_block_size( +/*====================*/ + fil_node_t* node) /*!< in: Node where to get block + size */ +{ + return (node->file_block_size); +} diff --git a/storage/xtradb/fil/fil0pagecompress.cc b/storage/xtradb/fil/fil0pagecompress.cc index d7bc0ff62e7..a4b0e1b486b 100644 --- a/storage/xtradb/fil/fil0pagecompress.cc +++ b/storage/xtradb/fil/fil0pagecompress.cc @@ -260,6 +260,7 @@ fil_compress_page( byte* out_buf, /*!< out: compressed buffer */ ulint len, /*!< in: length of input buffer.*/ ulint compression_level, /* in: compression level */ + ulint block_size, /*!< in: block size */ ulint* out_len, /*!< out: actual length of compressed page */ byte* lzo_mem) /*!< in: temporal memory used by LZO */ @@ -450,12 +451,11 @@ fil_compress_page( write_size+=header_len; -#define SECT_SIZE 512 - /* Actual write needs to be alligned on block size */ - if (write_size % SECT_SIZE) { - write_size = (write_size + SECT_SIZE-1) & ~(SECT_SIZE-1); - ut_a((write_size % SECT_SIZE) == 0); + if (write_size % block_size) { + ut_a(block_size > 0); + write_size = (write_size + block_size-1) & ~(block_size-1); + ut_a((write_size % block_size) == 0); } #ifdef UNIV_PAGECOMPRESS_DEBUG diff --git a/storage/xtradb/include/fil0pagecompress.h b/storage/xtradb/include/fil0pagecompress.h index 395a158b8f7..fb97af87460 100644 --- a/storage/xtradb/include/fil0pagecompress.h +++ b/storage/xtradb/include/fil0pagecompress.h @@ -93,6 +93,7 @@ fil_compress_page( byte* out_buf, /*!< out: compressed buffer */ ulint len, /*!< in: length of input buffer.*/ ulint compression_level, /*!< in: compression level */ + ulint block_size, /*!< in: block size */ ulint* out_len, /*!< out: actual length of compressed page */ byte* lzo_mem); /*!< in: temporal memory used by LZO */ @@ -117,8 +118,15 @@ Get space id from fil node ulint fil_node_get_space_id( /*==================*/ - fil_node_t* node); /*!< in: Node where to get space id*/ + fil_node_t* node); /*!< in: Node where to get space id*/ +/****************************************************************//** +Get block size from fil node +@return block size*/ +ulint +fil_node_get_block_size( + fil_node_t* node); /*!< in: Node where to get block + size */ /*******************************************************************//** Find out wheather the page is page compressed @return true if page is page compressed*/ diff --git a/storage/xtradb/include/os0file.h b/storage/xtradb/include/os0file.h index ba362a0e458..518c1605e96 100644 --- a/storage/xtradb/include/os0file.h +++ b/storage/xtradb/include/os0file.h @@ -1374,6 +1374,16 @@ os_file_handle_error_no_exit( any message to the log. */ +/***********************************************************************//** +Try to get number of bytes per sector from file system. +@return file block size */ +UNIV_INTERN +ulint +os_file_get_block_size( +/*===================*/ + os_file_t file, /*!< in: handle to a file */ + const char* name); /*!< in: file name */ + #ifndef UNIV_NONINL #include "os0file.ic" #endif diff --git a/storage/xtradb/include/srv0mon.h b/storage/xtradb/include/srv0mon.h index 8e6975ed68f..c1585c3072c 100644 --- a/storage/xtradb/include/srv0mon.h +++ b/storage/xtradb/include/srv0mon.h @@ -311,7 +311,12 @@ enum monitor_id_t { /* New monitor variables for page compression */ MONITOR_OVLD_PAGE_COMPRESS_SAVED, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384, + MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768, MONITOR_OVLD_PAGES_PAGE_COMPRESSED, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP, MONITOR_OVLD_PAGE_COMPRESSED_TRIM_OP_SAVED, diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index 3ed3ba71698..17c67ada04b 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -107,8 +107,18 @@ struct srv_stats_t { ulint_ctr_64_t page_compression_saved; /** Number of 512Byte TRIM by page compression */ ulint_ctr_64_t page_compression_trim_sect512; + /** Number of 1K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect1024; + /** Number of 2K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect2048; /** Number of 4K TRIM by page compression */ ulint_ctr_64_t page_compression_trim_sect4096; + /** Number of 8K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect8192; + /** Number of 16K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect16384; + /** Number of 32K TRIM by page compression */ + ulint_ctr_64_t page_compression_trim_sect32768; /* Number of index pages written */ ulint_ctr_64_t index_pages_written; /* Number of non index pages written */ @@ -1144,8 +1154,18 @@ struct export_var_t{ by page compression */ ib_int64_t innodb_page_compression_trim_sect512;/*!< Number of 512b TRIM by page compression */ + ib_int64_t innodb_page_compression_trim_sect1024;/*!< Number of 1K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect2048;/*!< Number of 2K TRIM + by page compression */ ib_int64_t innodb_page_compression_trim_sect4096;/*!< Number of 4K byte TRIM by page compression */ + ib_int64_t innodb_page_compression_trim_sect8192;/*!< Number of 8K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect16384;/*!< Number of 16K TRIM + by page compression */ + ib_int64_t innodb_page_compression_trim_sect32768;/*!< Number of 32K TRIM + by page compression */ ib_int64_t innodb_index_pages_written; /*!< Number of index pages written */ ib_int64_t innodb_non_index_pages_written; /*!< Number of non index pages diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 92e66ed7901..4aeb7654c69 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -2,7 +2,7 @@ Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2014, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -79,6 +79,10 @@ Created 10/21/1995 Heikki Tuuri # endif #endif +#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H) +#include <sys/statvfs.h> +#endif + #ifdef HAVE_LZO #include "lzo/lzo1x.h" #endif @@ -233,6 +237,10 @@ struct os_aio_slot_t{ free this */ ibool page_compress_success; + /*!< TRUE if page compression was + successfull, false if not */ + + ulint file_block_size;/*!< file block size */ #ifdef LINUX_NATIVE_AIO struct iocb control; /* Linux control block for aio */ @@ -354,9 +362,7 @@ UNIV_INTERN ibool os_file_trim( /*=========*/ - os_file_t file, /*!< in: file to be trimmed */ - os_aio_slot_t* slot, /*!< in: slot structure */ - ulint len); /*!< in: length of area */ + os_aio_slot_t* slot); /*!< in: slot structure */ /**********************************************************************//** Allocate memory for temporal buffer used for page compression. This @@ -4731,6 +4737,7 @@ found: slot->write_size = write_size; slot->page_compression_level = page_compression_level; slot->page_compression = page_compression; + slot->file_block_size = fil_node_get_block_size(message1); /* If the space is page compressed and this is write operation then we compress the page */ @@ -4759,6 +4766,7 @@ found: slot->page_buf, len, page_compression_level, + fil_node_get_block_size(slot->message1), &real_len, slot->lzo_mem ); @@ -5407,7 +5415,7 @@ os_aio_windows_handle( if (slot->page_compress_success && fil_page_is_compressed(slot->page_buf)) { if (srv_use_trim && os_fallocate_failed == FALSE) { // Deallocate unused blocks from file system - os_file_trim(slot->file, slot, slot->len); + os_file_trim(slot); } } } @@ -5525,7 +5533,7 @@ retry: ut_ad(slot->page_compression_page); if (srv_use_trim && os_fallocate_failed == FALSE) { // Deallocate unused blocks from file system - os_file_trim(slot->file, slot, slot->len); + os_file_trim(slot); } } } @@ -6436,17 +6444,17 @@ UNIV_INTERN ibool os_file_trim( /*=========*/ - os_file_t file, /*!< in: file to be trimmed */ - os_aio_slot_t* slot, /*!< in: slot structure */ - ulint len) /*!< in: length of area */ + os_aio_slot_t* slot) /*!< in: slot structure */ { - -#define SECT_SIZE 512 - size_t trim_len = UNIV_PAGE_SIZE - len; + size_t len = slot->len; + size_t trim_len = UNIV_PAGE_SIZE - slot->len; os_offset_t off __attribute__((unused)) = slot->offset + len; + size_t bsize = slot->file_block_size; + // len here should be alligned to sector size - ut_a((trim_len % SECT_SIZE) == 0); - ut_a((len % SECT_SIZE) == 0); + ut_ad((trim_len % bsize) == 0); + ut_ad((len % bsize) == 0); + ut_ad(bsize != 0); // Nothing to do if trim length is zero or if actual write // size is initialized and it is smaller than current write size. @@ -6476,7 +6484,7 @@ os_file_trim( #ifdef __linux__ #if defined(FALLOC_FL_PUNCH_HOLE) && defined (FALLOC_FL_KEEP_SIZE) - int ret = fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); + int ret = fallocate(slot->file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, off, trim_len); if (ret) { /* After first failure do not try to trim again */ @@ -6520,7 +6528,8 @@ os_file_trim( flt.Ranges[0].Offset = off; flt.Ranges[0].Length = trim_len; - BOOL ret = DeviceIoControl(file,FSCTL_FILE_LEVEL_TRIM,&flt, sizeof(flt), NULL, NULL, NULL, NULL); + BOOL ret = DeviceIoControl(slot->file, FSCTL_FILE_LEVEL_TRIM, + &flt, sizeof(flt), NULL, NULL, NULL, NULL); if (!ret) { /* After first failure do not try to trim again */ @@ -6546,8 +6555,32 @@ os_file_trim( } #endif - srv_stats.page_compression_trim_sect512.add((trim_len / SECT_SIZE)); - srv_stats.page_compression_trim_sect4096.add((trim_len / (SECT_SIZE*8))); + switch(bsize) { + case 512: + srv_stats.page_compression_trim_sect512.add((trim_len / bsize)); + break; + case 1024: + srv_stats.page_compression_trim_sect1024.add((trim_len / bsize)); + break; + case 2948: + srv_stats.page_compression_trim_sect2048.add((trim_len / bsize)); + break; + case 4096: + srv_stats.page_compression_trim_sect4096.add((trim_len / bsize)); + break; + case 8192: + srv_stats.page_compression_trim_sect8192.add((trim_len / bsize)); + break; + case 16384: + srv_stats.page_compression_trim_sect16384.add((trim_len / bsize)); + break; + case 32768: + srv_stats.page_compression_trim_sect32768.add((trim_len / bsize)); + break; + default: + break; + } + srv_stats.page_compressed_trim_op.inc(); return (TRUE); @@ -6590,3 +6623,57 @@ os_slot_alloc_lzo_mem( ut_a(slot->lzo_mem != NULL); } #endif + +/***********************************************************************//** +Try to get number of bytes per sector from file system. +@return file block size */ +UNIV_INTERN +ulint +os_file_get_block_size( +/*===================*/ + os_file_t file, /*!< in: handle to a file */ + const char* name) /*!< in: file name */ +{ + ulint fblock_size = 512; + +#if defined(UNIV_LINUX) && defined(HAVE_SYS_STATVFS_H) + struct statvfs fstat; + int err; + + err = fstatvfs(file, &fstat); + + if (err != 0) { + fprintf(stderr, "InnoDB: Warning: fstatvfs() failed on file %s\n", name); + os_file_handle_error_no_exit(name, "fstatvfs()", FALSE, __FILE__, __LINE__); + } else { + fblock_size = fstat.f_bsize; + } +#endif /* UNIV_LINUX */ +#ifdef __WIN__ + { + DWORD SectorsPerCluster = 0; + DWORD BytesPerSector = 0; + DWORD NumberOfFreeClusters = 0; + DWORD TotalNumberOfClusters = 0; + + if (GetFreeSpace((LPCTSTR)name, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters)) { + fblock_size = BytesPerSector; + fprintf(stderr, "InnoDB: [Note]: Using %ld file block size\n", fblock_size); + } else { + fprintf(stderr, "InnoDB: Warning: GetFreeSpace() failed on file %s\n", name); + os_file_handle_error_no_exit(name, "GetFreeSpace()", FALSE, __FILE__, __LINE__); + } + } +#endif /* __WIN__*/ + + if (fblock_size > UNIV_PAGE_SIZE/2) { + fprintf(stderr, "InnoDB: Warning: File system for file %s has " + "file block size %lu not supported for page_size %lu\n", + name, fblock_size, UNIV_PAGE_SIZE); + fblock_size = UNIV_PAGE_SIZE/2; + fprintf(stderr, "InnoDB: Note: Using file block size %ld for file %s\n", + fblock_size, name); + } + + return fblock_size; +} diff --git a/storage/xtradb/os/os0sync.cc b/storage/xtradb/os/os0sync.cc index e42c5900c0c..779152a3a56 100644 --- a/storage/xtradb/os/os0sync.cc +++ b/storage/xtradb/os/os0sync.cc @@ -686,7 +686,7 @@ os_event_wait_time_low( tv.tv_usec += time_in_usec; if ((ulint) tv.tv_usec >= MICROSECS_IN_A_SECOND) { - tv.tv_sec += time_in_usec / MICROSECS_IN_A_SECOND; + tv.tv_sec += tv.tv_usec / MICROSECS_IN_A_SECOND; tv.tv_usec %= MICROSECS_IN_A_SECOND; } diff --git a/storage/xtradb/srv/srv0mon.cc b/storage/xtradb/srv/srv0mon.cc index 5880e03073e..7be25966557 100644 --- a/storage/xtradb/srv/srv0mon.cc +++ b/storage/xtradb/srv/srv0mon.cc @@ -2,6 +2,7 @@ Copyright (c) 2010, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2013, 2014, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -901,11 +902,36 @@ static monitor_info_t innodb_counter_info[] = MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512}, + {"compress_trim_sect1024", "compression", + "Number of sect-1024 TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024}, + + {"compress_trim_sect2048", "compression", + "Number of sect-2048 TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048}, + {"compress_trim_sect4096", "compression", "Number of sect-4K TRIMed by page compression", MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096}, + {"compress_trim_sect8192", "compression", + "Number of sect-8K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192}, + + {"compress_trim_sect16384", "compression", + "Number of sect-16K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384}, + + {"compress_trim_sect32768", "compression", + "Number of sect-32K TRIMed by page compression", + MONITOR_NONE, + MONITOR_DEFAULT_START, MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768}, + {"compress_pages_page_compressed", "compression", "Number of pages compressed by page compression", MONITOR_NONE, @@ -1861,9 +1887,24 @@ srv_mon_process_existing_counter( case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT512: value = srv_stats.page_compression_trim_sect512; break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT1024: + value = srv_stats.page_compression_trim_sect1024; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT2048: + value = srv_stats.page_compression_trim_sect2048; + break; case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT4096: value = srv_stats.page_compression_trim_sect4096; break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT8192: + value = srv_stats.page_compression_trim_sect8192; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT16384: + value = srv_stats.page_compression_trim_sect16384; + break; + case MONITOR_OVLD_PAGE_COMPRESS_TRIM_SECT32768: + value = srv_stats.page_compression_trim_sect32768; + break; case MONITOR_OVLD_PAGES_PAGE_COMPRESSED: value = srv_stats.pages_page_compressed; break; |