Commit e135edec authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents 7725f870 1a66e3f8
...@@ -83,12 +83,6 @@ ...@@ -83,12 +83,6 @@
# define MSAN_STAT_WORKAROUND(st) ((void) 0) # define MSAN_STAT_WORKAROUND(st) ((void) 0)
#endif /* __has_feature(memory_sanitizer) */ #endif /* __has_feature(memory_sanitizer) */
#ifdef HAVE_valgrind
#define IF_VALGRIND(A,B) A
#else
#define IF_VALGRIND(A,B) B
#endif
#ifdef TRASH_FREED_MEMORY #ifdef TRASH_FREED_MEMORY
/* /*
_TRASH_FILL() has to call MEM_MAKE_ADDRESSABLE() to cancel any effect of _TRASH_FILL() has to call MEM_MAKE_ADDRESSABLE() to cancel any effect of
......
--source include/not_msan.inc
--source include/not_valgrind_build.inc --source include/not_valgrind_build.inc
--echo # MDEV-20699 do not cache SP in SHOW CREATE --echo # MDEV-20699 do not cache SP in SHOW CREATE
......
...@@ -56,5 +56,8 @@ flush tables; ...@@ -56,5 +56,8 @@ flush tables;
drop table if exists t1; drop table if exists t1;
exec rm -r $MYSQLTEST_VARDIR/tmp/foo; exec rm -r $MYSQLTEST_VARDIR/tmp/foo;
# Under Valgrind, this could display a warning ER_FILE_NOT_FOUND
--disable_warnings
drop table mysql.t1; drop table mysql.t1;
--enable_warnings
set debug_sync='RESET'; set debug_sync='RESET';
if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_bzip2' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with libbz2
}
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lz4' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with liblz4
}
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzma' AND variable_value = 'ON' `)
{
--skip Test requires InnoDB compiled with liblzma
}
if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_lzo' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with liblzo
}
if (! `SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_snappy' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with libsnappy
}
# This test is slow on buildbot.
--source include/big_test.inc
--disable_query_log
# This may be triggered on a slow system or one that lacks native AIO.
call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
--enable_query_log
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
create table innodb_page_compressed3 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=3;
create table innodb_page_compressed4 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=4;
create table innodb_page_compressed5 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=5;
create table innodb_page_compressed6 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=6;
create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
--disable_query_log
begin;
let $i = 2000;
while ($i)
{
insert into innodb_normal(b) values(REPEAT('Aa',50));
insert into innodb_normal(b) values(REPEAT('a',100));
insert into innodb_normal(b) values(REPEAT('b',100));
insert into innodb_normal(b) values(REPEAT('0',100));
insert into innodb_normal(b) values(REPEAT('1',100));
dec $i;
}
insert into innodb_page_compressed1 select * from innodb_normal;
insert into innodb_page_compressed2 select * from innodb_normal;
insert into innodb_page_compressed3 select * from innodb_normal;
insert into innodb_page_compressed4 select * from innodb_normal;
insert into innodb_page_compressed5 select * from innodb_normal;
insert into innodb_page_compressed6 select * from innodb_normal;
insert into innodb_page_compressed7 select * from innodb_normal;
insert into innodb_page_compressed8 select * from innodb_normal;
insert into innodb_page_compressed9 select * from innodb_normal;
commit;
--enable_query_log
select count(*) from innodb_page_compressed1;
select count(*) from innodb_page_compressed3;
select count(*) from innodb_page_compressed4;
select count(*) from innodb_page_compressed5;
select count(*) from innodb_page_compressed6;
select count(*) from innodb_page_compressed6;
select count(*) from innodb_page_compressed7;
select count(*) from innodb_page_compressed8;
select count(*) from innodb_page_compressed9;
#
# Wait until pages are really compressed
#
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
--source include/wait_condition.inc
--let $MYSQLD_DATADIR=`select @@datadir`
# shutdown before grep
--source include/shutdown_mysqld.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_normal.ibd
--let SEARCH_RANGE = 10000000
--let SEARCH_PATTERN=AaAaAaAa
--echo # innodb_normal expected FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed1.ibd
--echo # innodb_page_compressed1 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed2.ibd
--echo # innodb_page_compressed2 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed3.ibd
--echo # innodb_page_compressed3 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed4.ibd
--echo # innodb_page_compressed4 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed5.ibd
--echo # innodb_page_compressed5 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed6.ibd
--echo # innodb_page_compressed6 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed7.ibd
--echo # innodb_page_compressed7 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed8.ibd
--echo # innodb_page_compressed8 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--let t1_IBD = $MYSQLD_DATADIR/test/innodb_page_compressed9.ibd
--echo # innodb_page_compressed9 page compressed expected NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
-- source include/start_mysqld.inc
select count(*) from innodb_page_compressed1;
select count(*) from innodb_page_compressed3;
select count(*) from innodb_page_compressed4;
select count(*) from innodb_page_compressed5;
select count(*) from innodb_page_compressed6;
select count(*) from innodb_page_compressed6;
select count(*) from innodb_page_compressed7;
select count(*) from innodb_page_compressed8;
select count(*) from innodb_page_compressed9;
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED';
--source include/wait_condition.inc
drop table innodb_normal;
drop table innodb_page_compressed1;
drop table innodb_page_compressed2;
drop table innodb_page_compressed3;
drop table innodb_page_compressed4;
drop table innodb_page_compressed5;
drop table innodb_page_compressed6;
drop table innodb_page_compressed7;
drop table innodb_page_compressed8;
drop table innodb_page_compressed9;
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# ONLINE WITH MEMORY FULL CONDITION # ONLINE WITH MEMORY FULL CONDITION
# #
call mtr.add_suppression("InnoDB: failed to allocate the chunk array"); call mtr.add_suppression("InnoDB: failed to allocate the chunk array");
SET GLOBAL innodb_disable_resize_buffer_pool_debug=OFF;
SET GLOBAL debug_dbug='+d,buf_pool_resize_chunk_null'; SET GLOBAL debug_dbug='+d,buf_pool_resize_chunk_null';
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size + 1048576; SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size + 1048576;
# restart # restart
set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
ERROR HY000: Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=COMPRESSED
Error 1005 Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_compressed`=1
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
ERROR HY000: Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options")
show warnings;
Level Code Message
Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
Error 1005 Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
alter table innodb_redundant page_compressed=1;
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
show warnings;
Level Code Message
Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT
Error 1478 Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSED'
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
alter table innodb_redundant row_format=compact page_compressed=1;
show create table innodb_redundant;
Table Create Table
innodb_redundant CREATE TABLE `innodb_redundant` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1
drop table innodb_redundant;
#
# MDEV-24455 Assertion `!m_freed_space' failed in mtr_t::start
#
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED='ON';
BEGIN;
INSERT INTO t1 VALUES(REPEAT('x',81),REPEAT('x',8034));
ROLLBACK;
DROP TABLE t1;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
# restart
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
set global innodb_compression_algorithm = 0;
alter table innodb_compact page_compressed=DEFAULT, algorithm=instant;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_compact page_compressed=DEFAULT;
alter table innodb_dynamic page_compressed=DEFAULT, algorithm=instant;
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Changing table options requires the table to be rebuilt. Try ALGORITHM=INPLACE
alter table innodb_dynamic page_compressed=DEFAULT;
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
show create table innodb_dynamic;
Table Create Table
innodb_dynamic CREATE TABLE `innodb_dynamic` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
count(*)
5000
select count(*) from innodb_dynamic where c1 < 1500000;
count(*)
5000
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
CREATE TABLE no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB;
SET SESSION innodb_compression_default = 1;
CREATE TABLE default_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB;
CREATE TABLE explicit_no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB PAGE_COMPRESSED=0;
SHOW CREATE TABLE no_compression;
Table Create Table
no_compression CREATE TABLE `no_compression` (
`id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SHOW CREATE TABLE default_compression;
Table Create Table
default_compression CREATE TABLE `default_compression` (
`id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`='ON'
SHOW CREATE TABLE explicit_no_compression;
Table Create Table
explicit_no_compression CREATE TABLE `explicit_no_compression` (
`id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=0
DROP TABLE no_compression;
DROP TABLE default_compression;
DROP TABLE explicit_no_compression;
SET SESSION innodb_compression_default = 0;
set global innodb_file_per_table=ON;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connect con3,localhost,root,,;
connect con4,localhost,root,,;
connect con5,localhost,root,,;
connect con6,localhost,root,,;
connect con7,localhost,root,,;
connect con8,localhost,root,,;
create table t2 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t2 (c1, c2) values (1, 1);
create table t3 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t3 (c1, c2) values (1, 1);
create table t4 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t4 (c1, c2) values (1, 1);
create table t5 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t5 (c1, c2) values (1, 1);
create table t6 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t6 (c1, c2) values (1, 1);
create database test2;
create table test2.t7 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into test2.t7 (c1, c2) values (1, 1);
drop table test2.t7;
connection con1;
set @save_dbug=@@global.debug_dbug;
set global debug_dbug="+d,ib_buf_pool_resize_wait_before_resize";
set global innodb_buffer_pool_size = 12*1024*1024;
set global innodb_buffer_pool_size = 8*1024*1024;
ERROR HY000: Another buffer pool resize is already in progress.
select @@global.innodb_buffer_pool_size;
@@global.innodb_buffer_pool_size
8388608
select @@global.innodb_adaptive_hash_index;
@@global.innodb_adaptive_hash_index
0
set global innodb_adaptive_hash_index = ON;
select @@global.innodb_adaptive_hash_index;
@@global.innodb_adaptive_hash_index
0
set global innodb_adaptive_hash_index = OFF;
select @@global.innodb_adaptive_hash_index;
@@global.innodb_adaptive_hash_index
0
create table t1 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
connection con2;
set use_stat_tables=never;
analyze table t2;
connection con3;
alter table t3 algorithm=inplace, add index idx (c1);
connection con4;
alter table t4 rename to t0;
connection con5;
drop table t5;
connection con6;
alter table t6 discard tablespace;
connection con7;
drop database test2;
connection con8;
select count(*) > 0 from information_schema.innodb_buffer_page;
connection default;
set global debug_dbug=@save_dbug;
connection con1;
connection con2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
connection con3;
connection con4;
connection con5;
connection con6;
connection con7;
connection con8;
count(*) > 0
1
connection default;
disconnect con3;
disconnect con4;
disconnect con5;
disconnect con6;
disconnect con7;
disconnect con8;
disconnect con1;
disconnect con2;
call mtr.add_suppression("\\[ERROR\\] InnoDB: buffer pool 0 : failed to allocate new memory.");
connection default;
set global debug_dbug="+d,ib_buf_chunk_init_fails";
set global innodb_buffer_pool_size = 16*1024*1024;
set global debug_dbug=@save_dbug;
create table t8 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t8 (c1, c2) values (1, 1);
drop table t8;
drop table t1;
drop table t2;
drop table t3;
drop table t0;
drop table t6;
#
# BUG#23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE THE FIRST CHUNK
#
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
set @before_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size * 2;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
SET GLOBAL innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug; SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
SET @save_disable=@@GLOBAL.innodb_disable_resize_buffer_pool_debug;
SET @save_size=@@GLOBAL.innodb_buffer_pool_size; SET @save_size=@@GLOBAL.innodb_buffer_pool_size;
SET GLOBAL innodb_limit_optimistic_insert_debug=2; SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET GLOBAL innodb_disable_resize_buffer_pool_debug=OFF;
SET GLOBAL innodb_buffer_pool_size=16777216; SET GLOBAL innodb_buffer_pool_size=16777216;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 SELECT seq FROM seq_1_to_200; INSERT INTO t1 SELECT seq FROM seq_1_to_200;
...@@ -13,4 +11,3 @@ COUNT(*) MIN(a) MAX(a) ...@@ -13,4 +11,3 @@ COUNT(*) MIN(a) MAX(a)
DROP TEMPORARY TABLE t1; DROP TEMPORARY TABLE t1;
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_buffer_pool_size=@save_size; SET GLOBAL innodb_buffer_pool_size=@save_size;
SET GLOBAL innodb_disable_resize_buffer_pool_debug=@save_disable;
SET @save_algorithm = @@GLOBAL.innodb_compression_algorithm;
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
...@@ -8,81 +9,37 @@ create table innodb_page_compressed6 (c1 int not null auto_increment primary key ...@@ -8,81 +9,37 @@ create table innodb_page_compressed6 (c1 int not null auto_increment primary key
create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
select count(*) from innodb_page_compressed1; connect prevent_purge,localhost,root;
count(*) START TRANSACTION WITH CONSISTENT SNAPSHOT;
10000 connection default;
select count(*) from innodb_page_compressed3; begin;
count(*) insert into innodb_normal SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed1 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed4; insert into innodb_page_compressed2 SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed3 SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed4 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed5; insert into innodb_page_compressed5 SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed6 SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed7 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed6; insert into innodb_page_compressed8 SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed9 SET b=REPEAT('Aa',50);
10000 commit;
select count(*) from innodb_page_compressed6; FLUSH TABLES innodb_normal,
count(*) innodb_page_compressed1, innodb_page_compressed2, innodb_page_compressed3,
10000 innodb_page_compressed4, innodb_page_compressed5, innodb_page_compressed6,
select count(*) from innodb_page_compressed7; innodb_page_compressed7, innodb_page_compressed8, innodb_page_compressed9
count(*) FOR EXPORT;
10000 FOUND 12 /AaAaAaAa/ in innodb_normal.ibd
select count(*) from innodb_page_compressed8;
count(*)
10000
select count(*) from innodb_page_compressed9;
count(*)
10000
# innodb_normal expected FOUND
FOUND 24084 /AaAaAaAa/ in innodb_normal.ibd
# innodb_page_compressed1 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd
# innodb_page_compressed2 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd
# innodb_page_compressed3 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd
# innodb_page_compressed4 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd
# innodb_page_compressed5 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd
# innodb_page_compressed6 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd
# innodb_page_compressed7 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd
# innodb_page_compressed8 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd
# innodb_page_compressed9 page compressed expected NOT FOUND
NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
# restart UNLOCK TABLES;
select count(*) from innodb_page_compressed1;
count(*)
10000
select count(*) from innodb_page_compressed3;
count(*)
10000
select count(*) from innodb_page_compressed4;
count(*)
10000
select count(*) from innodb_page_compressed5;
count(*)
10000
select count(*) from innodb_page_compressed6;
count(*)
10000
select count(*) from innodb_page_compressed6;
count(*)
10000
select count(*) from innodb_page_compressed7;
count(*)
10000
select count(*) from innodb_page_compressed8;
count(*)
10000
select count(*) from innodb_page_compressed9;
count(*)
10000
drop table innodb_normal; drop table innodb_normal;
drop table innodb_page_compressed1; drop table innodb_page_compressed1;
drop table innodb_page_compressed2; drop table innodb_page_compressed2;
...@@ -93,4 +50,4 @@ drop table innodb_page_compressed6; ...@@ -93,4 +50,4 @@ drop table innodb_page_compressed6;
drop table innodb_page_compressed7; drop table innodb_page_compressed7;
drop table innodb_page_compressed8; drop table innodb_page_compressed8;
drop table innodb_page_compressed9; drop table innodb_page_compressed9;
#done SET GLOBAL innodb_compression_algorithm=@save_algorithm;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
SET debug_dbug = '+d,increase_mtr_checkpoint_size';
set global innodb_log_checkpoint_now = 1;
DROP DATABASE very_long_database_name;
SET GLOBAL innodb_flush_sync=OFF;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
# Commit the multi-rec mini transaction if mtr size
# exceeds LOG_CHECKPOINT_FREE_PER_THREAD size during checkpoint.
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
set global innodb_log_checkpoint_now = 1;
DROP DATABASE very_long_database_name;
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
call mtr.add_suppression("InnoDB: failed to allocate the chunk array"); call mtr.add_suppression("InnoDB: failed to allocate the chunk array");
SET GLOBAL innodb_disable_resize_buffer_pool_debug=OFF;
SET GLOBAL debug_dbug='+d,buf_pool_resize_chunk_null'; SET GLOBAL debug_dbug='+d,buf_pool_resize_chunk_null';
--disable_warnings --disable_warnings
......
--source include/have_innodb.inc
--source include/not_embedded.inc
# All page compression test use the same
--source include/innodb-page-compression.inc
-- echo #done
-- source include/have_innodb.inc
-- source include/have_innodb_lzo.inc
-- source include/not_embedded.inc
--disable_query_log
# This may be triggered on a slow system or one that lacks native AIO.
call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
--enable_query_log
# lzo
set global innodb_compression_algorithm = 3;
--disable_query_log
SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
show warnings;
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
show warnings;
show create table innodb_page_compressed1;
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
show warnings;
show create table innodb_page_compressed2;
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
show warnings;
show create table innodb_page_compressed3;
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
show warnings;
show create table innodb_page_compressed4;
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
show warnings;
show create table innodb_page_compressed5;
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
show warnings;
show create table innodb_page_compressed6;
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
show warnings;
show create table innodb_page_compressed7;
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
show warnings;
show create table innodb_page_compressed8;
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
show warnings;
show create table innodb_page_compressed9;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num,'testing..');
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
select count(*) from innodb_normal;
insert into innodb_compressed select * from innodb_normal;
insert into innodb_page_compressed1 select * from innodb_normal;
insert into innodb_page_compressed2 select * from innodb_normal;
insert into innodb_page_compressed3 select * from innodb_normal;
insert into innodb_page_compressed4 select * from innodb_normal;
insert into innodb_page_compressed5 select * from innodb_normal;
insert into innodb_page_compressed6 select * from innodb_normal;
insert into innodb_page_compressed7 select * from innodb_normal;
insert into innodb_page_compressed8 select * from innodb_normal;
insert into innodb_page_compressed9 select * from innodb_normal;
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;
alter table innodb_normal page_compressed=1 page_compression_level=8,
algorithm=instant;
show warnings;
show create table innodb_normal;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
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;
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;
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compressed;
drop table innodb_page_compressed1;
drop table innodb_page_compressed2;
drop table innodb_page_compressed3;
drop table innodb_page_compressed4;
drop table innodb_page_compressed5;
drop table innodb_page_compressed6;
drop table innodb_page_compressed7;
drop table innodb_page_compressed8;
drop table innodb_page_compressed9;
-- source include/have_innodb.inc
-- source include/have_innodb_snappy.inc
--source include/not_embedded.inc
# snappy
set global innodb_compression_algorithm = snappy;
# All page compression test use the same
--source include/innodb-page-compression.inc
-- echo #done
--source include/have_innodb.inc
--source include/not_embedded.inc
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
--disable_query_log
# This may be triggered on a slow system or one that lacks native AIO.
call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
--enable_query_log
# zlib
set global innodb_compression_algorithm = 1;
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1;
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1;
--error 1005
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1;
show warnings;
show create table innodb_compact;
show create table innodb_dynamic;
# MDEV-7133: InnoDB: Assertion failure in thread 140737091569408 in file dict0mem.cc line 74
# InnoDB: Failing assertion: dict_tf_is_valid(flags)
--error 1005
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1;
show warnings;
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
show create table innodb_redundant;
--error ER_ILLEGAL_HA_CREATE_OPTION
alter table innodb_redundant page_compressed=1;
show warnings;
show create table innodb_redundant;
alter table innodb_redundant row_format=compact page_compressed=1;
show create table innodb_redundant;
drop table innodb_redundant;
--echo #
--echo # MDEV-24455 Assertion `!m_freed_space' failed in mtr_t::start
--echo #
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED='ON';
BEGIN; INSERT INTO t1 VALUES(REPEAT('x',81),REPEAT('x',8034)); ROLLBACK;
DROP TABLE t1;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
insert into innodb_compact select * from innodb_normal;
insert into innodb_dynamic select * from innodb_normal;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
--source include/restart_mysqld.inc
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
# none
set global innodb_compression_algorithm = 0;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_compact page_compressed=DEFAULT, algorithm=instant;
alter table innodb_compact page_compressed=DEFAULT;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_dynamic page_compressed=DEFAULT, algorithm=instant;
alter table innodb_dynamic page_compressed=DEFAULT;
show create table innodb_compact;
show create table innodb_dynamic;
update innodb_compact set c1 = c1 + 1;
update innodb_dynamic set c1 = c1 + 1;
select count(*) from innodb_compact where c1 < 1500000;
select count(*) from innodb_dynamic where c1 < 1500000;
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compact;
drop table innodb_dynamic;
# MDEV-9820 introducing variable for having page compression turned on by default on InnoDB tables
# test that innodb_compression_default works as expected, i.e. if it has a value of 1 (ON) tables are by default created with page_compressed=1;
CREATE TABLE no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB;
SET SESSION innodb_compression_default = 1;
CREATE TABLE default_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB;
CREATE TABLE explicit_no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB PAGE_COMPRESSED=0;
SHOW CREATE TABLE no_compression;
SHOW CREATE TABLE default_compression;
SHOW CREATE TABLE explicit_no_compression;
DROP TABLE no_compression;
DROP TABLE default_compression;
DROP TABLE explicit_no_compression;
SET SESSION innodb_compression_default = 0;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
--enable_query_log
--source include/have_innodb.inc
--source include/not_embedded.inc
# This test is slow on buildbot.
--source include/big_test.inc
--disable_query_log
# This may be triggered on a slow system or one that lacks native AIO.
call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operations");
--enable_query_log
# zlib
set global innodb_compression_algorithm = 1;
--disable_query_log
SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
show warnings;
create table innodb_page_compressed1 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=1;
show warnings;
show create table innodb_page_compressed1;
create table innodb_page_compressed2 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=2;
show warnings;
show create table innodb_page_compressed2;
create table innodb_page_compressed3 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=3;
show warnings;
show create table innodb_page_compressed3;
create table innodb_page_compressed4 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=4;
show warnings;
show create table innodb_page_compressed4;
create table innodb_page_compressed5 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=5;
show warnings;
show create table innodb_page_compressed5;
create table innodb_page_compressed6 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=6;
show warnings;
show create table innodb_page_compressed6;
create table innodb_page_compressed7 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=7;
show warnings;
show create table innodb_page_compressed7;
create table innodb_page_compressed8 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=8;
show warnings;
show create table innodb_page_compressed8;
create table innodb_page_compressed9 (c1 int, b char(20)) engine=innodb page_compressed=1 page_compression_level=9;
show warnings;
show create table innodb_page_compressed9;
delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
declare current_num int;
set current_num = 0;
while current_num < repeat_count do
insert into innodb_normal values(current_num,'testing..');
set current_num = current_num + 1;
end while;
end//
delimiter ;//
commit;
set autocommit=0;
call innodb_insert_proc(5000);
commit;
set autocommit=1;
select count(*) from innodb_normal;
insert into innodb_compressed select * from innodb_normal;
insert into innodb_page_compressed1 select * from innodb_normal;
insert into innodb_page_compressed2 select * from innodb_normal;
insert into innodb_page_compressed3 select * from innodb_normal;
insert into innodb_page_compressed4 select * from innodb_normal;
insert into innodb_page_compressed5 select * from innodb_normal;
insert into innodb_page_compressed6 select * from innodb_normal;
insert into innodb_page_compressed7 select * from innodb_normal;
insert into innodb_page_compressed8 select * from innodb_normal;
insert into innodb_page_compressed9 select * from innodb_normal;
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;
alter table innodb_normal page_compressed=1 page_compression_level=8,
algorithm=instant;
show warnings;
show create table innodb_normal;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=instant;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0, algorithm=nocopy;
alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
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;
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;
drop procedure innodb_insert_proc;
drop table innodb_normal;
drop table innodb_compressed;
drop table innodb_page_compressed1;
drop table innodb_page_compressed2;
drop table innodb_page_compressed3;
drop table innodb_page_compressed4;
drop table innodb_page_compressed5;
drop table innodb_page_compressed6;
drop table innodb_page_compressed7;
drop table innodb_page_compressed8;
drop table innodb_page_compressed9;
...@@ -14,11 +14,6 @@ let $wait_condition = ...@@ -14,11 +14,6 @@ let $wait_condition =
--disable_query_log --disable_query_log
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size; set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index; set @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
if (`select (version() like '%debug%') > 0`)
{
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
}
--enable_query_log --enable_query_log
set global innodb_adaptive_hash_index=ON; set global innodb_adaptive_hash_index=ON;
...@@ -73,9 +68,5 @@ drop view view0; ...@@ -73,9 +68,5 @@ drop view view0;
--disable_query_log --disable_query_log
set global innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index; set global innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size; set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
if (`select (version() like '%debug%') > 0`)
{
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
}
--enable_query_log --enable_query_log
--source include/wait_condition.inc --source include/wait_condition.inc
#
# WL6117 : Resize the InnoDB Buffer Pool Online
# (concurrent sql; allocation fail;)
#
--source include/have_innodb.inc
--source include/have_debug.inc
--disable_query_log
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set @old_innodb_file_per_table = @@innodb_file_per_table;
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
call mtr.add_suppression("\\[ERROR\\] InnoDB: failed to allocate memory for buffer pool chunk");
--enable_query_log
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
let $wait_timeout = 180;
set global innodb_file_per_table=ON;
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connect (con3,localhost,root,,);
connect (con4,localhost,root,,);
connect (con5,localhost,root,,);
connect (con6,localhost,root,,);
connect (con7,localhost,root,,);
connect (con8,localhost,root,,);
create table t2 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t2 (c1, c2) values (1, 1);
create table t3 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t3 (c1, c2) values (1, 1);
create table t4 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t4 (c1, c2) values (1, 1);
create table t5 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t5 (c1, c2) values (1, 1);
create table t6 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t6 (c1, c2) values (1, 1);
create database test2;
create table test2.t7 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into test2.t7 (c1, c2) values (1, 1);
drop table test2.t7;
connection con1;
set @save_dbug=@@global.debug_dbug;
set global debug_dbug="+d,ib_buf_pool_resize_wait_before_resize";
set global innodb_buffer_pool_size = 12*1024*1024;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 30) = 'Latching whole of buffer pool.'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
# trying to update innodb_buffer_pool_size
--error ER_WRONG_ARGUMENTS
set global innodb_buffer_pool_size = 8*1024*1024;
select @@global.innodb_buffer_pool_size;
# trying to control adaptive hash index
select @@global.innodb_adaptive_hash_index;
set global innodb_adaptive_hash_index = ON;
select @@global.innodb_adaptive_hash_index;
set global innodb_adaptive_hash_index = OFF;
select @@global.innodb_adaptive_hash_index;
# - create table
--send create table t1 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB
connection con2;
# - analyze table
set use_stat_tables=never;
--send analyze table t2
connection con3;
# - alter table ... algorithm=inplace
--send alter table t3 algorithm=inplace, add index idx (c1)
connection con4;
# - alter table ... rename to
--send alter table t4 rename to t0
connection con5;
# - drop table
--send drop table t5
connection con6;
# - alter table ... discard tablespace
--send alter table t6 discard tablespace
connection con7;
# - drop database
--send drop database test2
connection con8;
# information schema INNODB_BUFFER_PAGE
--send select count(*) > 0 from information_schema.innodb_buffer_page
connection default;
set global debug_dbug=@save_dbug;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
connection con1;
--reap
connection con2;
--reap
connection con3;
--reap
connection con4;
--reap
connection con5;
--reap
connection con6;
--reap
connection con7;
--reap
connection con8;
--reap
connection default;
disconnect con3;
disconnect con4;
disconnect con5;
disconnect con6;
disconnect con7;
disconnect con8;
disconnect con1;
disconnect con2;
# fails to allocate new chunks
call mtr.add_suppression("\\[ERROR\\] InnoDB: buffer pool 0 : failed to allocate new memory.");
connection default;
set global debug_dbug="+d,ib_buf_chunk_init_fails";
set global innodb_buffer_pool_size = 16*1024*1024;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 27) = 'Resizing buffer pool failed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global debug_dbug=@save_dbug;
# can be used as usual, even if failed to allocate
create table t8 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB;
insert into t8 (c1, c2) values (1, 1);
drop table t8;
drop table t1;
drop table t2;
drop table t3;
drop table t0;
drop table t6;
--disable_query_log
set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
set global innodb_file_per_table = @old_innodb_file_per_table;
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
--enable_query_log
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
# Wait till all disconnects are completed]
--source include/wait_until_count_sessions.inc
--echo #
--echo # BUG#23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE THE FIRST CHUNK
--echo #
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
set @before_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change'
FROM information_schema.global_status
WHERE VARIABLE_NAME = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size * 2;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 9) = 'Completed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 9) = 'Completed'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size;
let $wait_timeout = 60;
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change'
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS';
--source include/wait_condition.inc
SET GLOBAL innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
--source include/have_debug.inc --source include/have_debug.inc
SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug; SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
SET @save_disable=@@GLOBAL.innodb_disable_resize_buffer_pool_debug;
SET @save_size=@@GLOBAL.innodb_buffer_pool_size; SET @save_size=@@GLOBAL.innodb_buffer_pool_size;
SET GLOBAL innodb_limit_optimistic_insert_debug=2; SET GLOBAL innodb_limit_optimistic_insert_debug=2;
SET GLOBAL innodb_disable_resize_buffer_pool_debug=OFF;
SET GLOBAL innodb_buffer_pool_size=16777216; SET GLOBAL innodb_buffer_pool_size=16777216;
...@@ -27,4 +25,3 @@ DROP TEMPORARY TABLE t1; ...@@ -27,4 +25,3 @@ DROP TEMPORARY TABLE t1;
SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit; SET GLOBAL innodb_limit_optimistic_insert_debug=@save_limit;
SET GLOBAL innodb_buffer_pool_size=@save_size; SET GLOBAL innodb_buffer_pool_size=@save_size;
SET GLOBAL innodb_disable_resize_buffer_pool_debug=@save_disable;
...@@ -14,11 +14,6 @@ let $wait_condition = ...@@ -14,11 +14,6 @@ let $wait_condition =
--disable_query_log --disable_query_log
set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size; set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
if (`select (version() like '%debug%') > 0`)
{
set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug;
set global innodb_disable_resize_buffer_pool_debug = OFF;
}
--enable_query_log --enable_query_log
select @@innodb_buffer_pool_chunk_size; select @@innodb_buffer_pool_chunk_size;
...@@ -62,9 +57,5 @@ select @@innodb_buffer_pool_size; ...@@ -62,9 +57,5 @@ select @@innodb_buffer_pool_size;
--disable_query_log --disable_query_log
set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size; set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
if (`select (version() like '%debug%') > 0`)
{
set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize;
}
--enable_query_log --enable_query_log
--source include/wait_condition.inc --source include/wait_condition.inc
[bzip2]
[lz4]
[lzma]
[lzo]
[snappy]
[zlib]
set global innodb_compression_algorithm = snappy; -- source include/have_innodb.inc
SET @save_algorithm = @@GLOBAL.innodb_compression_algorithm;
let $alg=`select regexp_replace('$MTR_COMBINATIONS', 'innodb,\|,innodb', '')`;
if (!`select '$alg' = 'zlib'`)
{
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_have_$alg' AND variable_value = 'ON'`)
{
--skip Test requires InnoDB compiled with $alg
}
--disable_query_log
eval SET GLOBAL innodb_compression_algorithm=$alg;
--enable_query_log
}
create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb; create table innodb_normal (c1 int not null auto_increment primary key, b char(200)) engine=innodb;
create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1; create table innodb_page_compressed1 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=1;
create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2; create table innodb_page_compressed2 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=2;
...@@ -9,81 +24,55 @@ create table innodb_page_compressed6 (c1 int not null auto_increment primary key ...@@ -9,81 +24,55 @@ create table innodb_page_compressed6 (c1 int not null auto_increment primary key
create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7; create table innodb_page_compressed7 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=7;
create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8; create table innodb_page_compressed8 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=8;
create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9; create table innodb_page_compressed9 (c1 int not null auto_increment primary key, b char(200)) engine=innodb page_compressed=1 page_compression_level=9;
select count(*) from innodb_page_compressed1;
count(*) connect (prevent_purge,localhost,root);
10000 START TRANSACTION WITH CONSISTENT SNAPSHOT;
select count(*) from innodb_page_compressed3; connection default;
count(*)
10000 begin;
select count(*) from innodb_page_compressed4; insert into innodb_normal SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed1 SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed2 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed5; insert into innodb_page_compressed3 SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed4 SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed5 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed6; insert into innodb_page_compressed6 SET b=REPEAT('Aa',50);
count(*) insert into innodb_page_compressed7 SET b=REPEAT('Aa',50);
10000 insert into innodb_page_compressed8 SET b=REPEAT('Aa',50);
select count(*) from innodb_page_compressed6; insert into innodb_page_compressed9 SET b=REPEAT('Aa',50);
count(*) commit;
10000
select count(*) from innodb_page_compressed7; FLUSH TABLES innodb_normal,
count(*) innodb_page_compressed1, innodb_page_compressed2, innodb_page_compressed3,
10000 innodb_page_compressed4, innodb_page_compressed5, innodb_page_compressed6,
select count(*) from innodb_page_compressed8; innodb_page_compressed7, innodb_page_compressed8, innodb_page_compressed9
count(*) FOR EXPORT;
10000
select count(*) from innodb_page_compressed9; --let $MYSQLD_DATADIR=`select @@datadir`
count(*) --let SEARCH_PATTERN=AaAaAaAa
10000 --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_normal.ibd
# innodb_normal expected FOUND --source include/search_pattern_in_file.inc
FOUND 24084 /AaAaAaAa/ in innodb_normal.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed1.ibd
# innodb_page_compressed1 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed1.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed2.ibd
# innodb_page_compressed2 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed2.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed3.ibd
# innodb_page_compressed3 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed3.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed4.ibd
# innodb_page_compressed4 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed4.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed5.ibd
# innodb_page_compressed5 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed5.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed6.ibd
# innodb_page_compressed6 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed6.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed7.ibd
# innodb_page_compressed7 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed7.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed8.ibd
# innodb_page_compressed8 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed8.ibd --let SEARCH_FILE=$MYSQLD_DATADIR/test/innodb_page_compressed9.ibd
# innodb_page_compressed9 page compressed expected NOT FOUND --source include/search_pattern_in_file.inc
NOT FOUND /AaAaAaAa/ in innodb_page_compressed9.ibd
# restart UNLOCK TABLES;
select count(*) from innodb_page_compressed1;
count(*)
10000
select count(*) from innodb_page_compressed3;
count(*)
10000
select count(*) from innodb_page_compressed4;
count(*)
10000
select count(*) from innodb_page_compressed5;
count(*)
10000
select count(*) from innodb_page_compressed6;
count(*)
10000
select count(*) from innodb_page_compressed6;
count(*)
10000
select count(*) from innodb_page_compressed7;
count(*)
10000
select count(*) from innodb_page_compressed8;
count(*)
10000
select count(*) from innodb_page_compressed9;
count(*)
10000
drop table innodb_normal; drop table innodb_normal;
drop table innodb_page_compressed1; drop table innodb_page_compressed1;
drop table innodb_page_compressed2; drop table innodb_page_compressed2;
...@@ -94,4 +83,4 @@ drop table innodb_page_compressed6; ...@@ -94,4 +83,4 @@ drop table innodb_page_compressed6;
drop table innodb_page_compressed7; drop table innodb_page_compressed7;
drop table innodb_page_compressed8; drop table innodb_page_compressed8;
drop table innodb_page_compressed9; drop table innodb_page_compressed9;
#done SET GLOBAL innodb_compression_algorithm=@save_algorithm;
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/big_test.inc
# Embedded server tests do not support restarting
--source include/not_embedded.inc
# This often fails under MSAN builder due timing differences
--source include/not_msan.inc
# The test does work with any page size, but we want to reduce the
# test running time by limiting the combinations. The redo log format
# is independent of the page size.
--source include/have_innodb_16k.inc
let $restart_noprint=2;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
let $i=1300;
--disable_query_log
while ($i)
{
eval CREATE TABLE veryLongTableNameToCreateMLOG_FILE_NAMErecords$i (a SERIAL)
ENGINE=InnoDB;
dec $i;
}
--enable_query_log
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
SET debug_dbug = '+d,increase_mtr_checkpoint_size';
set global innodb_log_checkpoint_now = 1;
--let $restart_timeout=0
--source include/restart_mysqld.inc
DROP DATABASE very_long_database_name;
SET GLOBAL innodb_flush_sync=OFF;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
--echo # Commit the multi-rec mini transaction if mtr size
--echo # exceeds LOG_CHECKPOINT_FREE_PER_THREAD size during checkpoint.
CREATE DATABASE very_long_database_name;
USE very_long_database_name;
let $i=1300;
--disable_query_log
while ($i)
{
eval CREATE TABLE veryLongTableNameToCreateMLOG_FILE_NAMErecords$i (a SERIAL)
ENGINE=InnoDB;
dec $i;
}
--enable_query_log
set global innodb_log_checkpoint_now = 1;
--let $restart_parameters = --debug-dbug=d,reduce_recv_parsing_buf
--source include/restart_mysqld.inc
DROP DATABASE very_long_database_name;
...@@ -412,9 +412,7 @@ insert into test.sanity values ...@@ -412,9 +412,7 @@ insert into test.sanity values
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DATA_FILE_PATH"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DATA_FILE_PATH"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DATA_HOME_DIR"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DATA_HOME_DIR"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DEFAULT_ROW_FORMAT"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DEFAULT_ROW_FORMAT"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DICT_STATS_DISABLED_DEBUG"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DISABLE_BACKGROUND_MERGE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DISABLE_BACKGROUND_MERGE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DISABLE_RESIZE_BUFFER_POOL_DEBUG"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DISABLE_SORT_FILE_CACHE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DISABLE_SORT_FILE_CACHE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DOUBLEWRITE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_DOUBLEWRITE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_FAST_SHUTDOWN"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_FAST_SHUTDOWN"),
...@@ -449,7 +447,6 @@ insert into test.sanity values ...@@ -449,7 +447,6 @@ insert into test.sanity values
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LOG_GROUP_HOME_DIR"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LOG_GROUP_HOME_DIR"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LOG_WRITE_AHEAD_SIZE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LOG_WRITE_AHEAD_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LRU_SCAN_DEPTH"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_LRU_SCAN_DEPTH"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MASTER_THREAD_DISABLED_DEBUG"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_DIRTY_PAGES_PCT"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_DIRTY_PAGES_PCT"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_DIRTY_PAGES_PCT_LWM"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_DIRTY_PAGES_PCT_LWM"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_PURGE_LAG"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_MAX_PURGE_LAG"),
...@@ -466,7 +463,6 @@ insert into test.sanity values ...@@ -466,7 +463,6 @@ insert into test.sanity values
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_ONLINE_ALTER_LOG_MAX_SIZE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_ONLINE_ALTER_LOG_MAX_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_OPEN_FILES"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_OPEN_FILES"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_OPTIMIZE_FULLTEXT_ONLY"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_OPTIMIZE_FULLTEXT_ONLY"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PAGE_CLEANER_DISABLED_DEBUG"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PAGE_SIZE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PAGE_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PRINT_ALL_DEADLOCKS"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PRINT_ALL_DEADLOCKS"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PURGE_BATCH_SIZE"), ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_PURGE_BATCH_SIZE"),
......
#
# Basic test for innodb_disable_resize_buffer_pool_debug
#
SET @start_global_value = @@global.innodb_disable_resize_buffer_pool_debug;
SET @@global.innodb_disable_resize_buffer_pool_debug = 0;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
@@global.innodb_disable_resize_buffer_pool_debug
0
SET @@global.innodb_disable_resize_buffer_pool_debug ='On' ;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
@@global.innodb_disable_resize_buffer_pool_debug
1
SET @@global.innodb_disable_resize_buffer_pool_debug ='Off' ;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
@@global.innodb_disable_resize_buffer_pool_debug
0
SET @@global.innodb_disable_resize_buffer_pool_debug = 1;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
@@global.innodb_disable_resize_buffer_pool_debug
1
SELECT IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug;
@@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug
1
1 Expected
SELECT COUNT(@@innodb_disable_resize_buffer_pool_debug);
COUNT(@@innodb_disable_resize_buffer_pool_debug)
1
1 Expected
SELECT COUNT(@@local.innodb_disable_resize_buffer_pool_debug);
ERROR HY000: Variable 'innodb_disable_resize_buffer_pool_debug' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.innodb_disable_resize_buffer_pool_debug);
ERROR HY000: Variable 'innodb_disable_resize_buffer_pool_debug' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug)
1
1 Expected
SELECT innodb_disable_resize_buffer_pool_debug = @@SESSION.innodb_disable_resize_buffer_pool_debug;
ERROR 42S22: Unknown column 'innodb_disable_resize_buffer_pool_debug' in 'field list'
SET @@global.innodb_disable_resize_buffer_pool_debug = @start_global_value;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
@@global.innodb_disable_resize_buffer_pool_debug
1
...@@ -511,30 +511,6 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -511,30 +511,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DICT_STATS_DISABLED_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Disable dict_stats thread
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_DISABLE_RESIZE_BUFFER_POOL_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Disable resizing buffer pool to make assertion code not expensive.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_DISABLE_SORT_FILE_CACHE VARIABLE_NAME INNODB_DISABLE_SORT_FILE_CACHE
SESSION_VALUE NULL SESSION_VALUE NULL
DEFAULT_VALUE OFF DEFAULT_VALUE OFF
...@@ -1087,18 +1063,6 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -1087,18 +1063,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_MASTER_THREAD_DISABLED_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Disable master thread
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT VARIABLE_NAME INNODB_MAX_DIRTY_PAGES_PCT
SESSION_VALUE NULL SESSION_VALUE NULL
DEFAULT_VALUE 90.000000 DEFAULT_VALUE 90.000000
...@@ -1291,18 +1255,6 @@ NUMERIC_BLOCK_SIZE NULL ...@@ -1291,18 +1255,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON ENUM_VALUE_LIST OFF,ON
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT NONE COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_PAGE_CLEANER_DISABLED_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Disable page cleaner
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_PAGE_SIZE VARIABLE_NAME INNODB_PAGE_SIZE
SESSION_VALUE NULL SESSION_VALUE NULL
DEFAULT_VALUE 16384 DEFAULT_VALUE 16384
......
...@@ -24,13 +24,6 @@ ...@@ -24,13 +24,6 @@
--source include/have_innodb.inc --source include/have_innodb.inc
--disable_query_log
if (`select (version() like '%debug%') > 0`)
{
set global innodb_disable_resize_buffer_pool_debug = OFF;
}
--enable_query_log
let $wait_condition = let $wait_condition =
SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at ' SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
FROM information_schema.global_status FROM information_schema.global_status
......
--echo #
--echo # Basic test for innodb_disable_resize_buffer_pool_debug
--echo #
--source include/have_innodb.inc
# The config variable is a debug variable
-- source include/have_debug.inc
SET @start_global_value = @@global.innodb_disable_resize_buffer_pool_debug;
# Check if Value can set
SET @@global.innodb_disable_resize_buffer_pool_debug = 0;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
SET @@global.innodb_disable_resize_buffer_pool_debug ='On' ;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
SET @@global.innodb_disable_resize_buffer_pool_debug ='Off' ;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
SET @@global.innodb_disable_resize_buffer_pool_debug = 1;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
# Check if the value in GLOBAL Table matches value in variable
--disable_warnings
SELECT IF(@@GLOBAL.innodb_disable_resize_buffer_pool_debug,'ON','OFF') = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
--enable_warnings
--echo 1 Expected
SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
--echo 1 Expected
--disable_warnings
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_disable_resize_buffer_pool_debug';
--enable_warnings
--echo 1 Expected
# Check if accessing variable with and without GLOBAL point to same variable
SELECT @@innodb_disable_resize_buffer_pool_debug = @@GLOBAL.innodb_disable_resize_buffer_pool_debug;
--echo 1 Expected
# Check if innodb_disable_resize_buffer_pool_debug can be accessed with and without @@ sign
SELECT COUNT(@@innodb_disable_resize_buffer_pool_debug);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_disable_resize_buffer_pool_debug);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_disable_resize_buffer_pool_debug);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_disable_resize_buffer_pool_debug);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_disable_resize_buffer_pool_debug = @@SESSION.innodb_disable_resize_buffer_pool_debug;
# Cleanup
SET @@global.innodb_disable_resize_buffer_pool_debug = @start_global_value;
SELECT @@global.innodb_disable_resize_buffer_pool_debug;
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. # Copyright (c) 2005, 2015, Oracle and/or its affiliates.
# Copyright (c) 2008, 2019, MariaDB # Copyright (c) 2008, 2022, MariaDB
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public # modify it under the terms of the GNU Library General Public
...@@ -100,137 +100,6 @@ ...@@ -100,137 +100,6 @@
fun:_dl_start fun:_dl_start
} }
#
# Warnings in libz becasue it works with aligned memory(?)
#
{
libz tr_flush_block
Memcheck:Cond
fun:_tr_flush_block
fun:deflate_slow
fun:deflate
fun:do_flush
fun:gzclose
}
{
libz tr_flush_block2
Memcheck:Cond
fun:_tr_flush_block
fun:deflate_slow
fun:deflate
fun:compress2
}
{
libz longest_match
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:do_flush
}
{
libz longest_match called from btr_store_big_rec_extern_fields
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:btr_store_big_rec_extern_fields
}
{
libz longest_match called from page_zip_compress
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:page_zip_compress
}
{
libz longest_match2
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:compress2
}
{
libz longest_match 3
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:gzclose
}
{
libz longest_match 4
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:gzflush
}
{
libz longest_match3
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:azflush
}
{
libz longest_match3
Memcheck:Cond
fun:longest_match
fun:deflate_slow
fun:deflate
fun:azclose
}
{
libz deflate
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
fun:compress2
}
{
libz deflate2
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
obj:*/libz.so.*
fun:gzflush
}
{
libz deflate3
Memcheck:Cond
obj:*/libz.so.*
obj:*/libz.so.*
fun:deflate
fun:do_flush
}
{
libz inflatereset2
Memcheck:Cond
fun:inflateReset2
fun:inflateInit2_
fun:uncompress
}
# #
# Warning from my_thread_init becasue mysqld dies before kill thread exists # Warning from my_thread_init becasue mysqld dies before kill thread exists
...@@ -705,39 +574,6 @@ ...@@ -705,39 +574,6 @@
fun:buf_buddy_relocate fun:buf_buddy_relocate
} }
{
Bug 59874 Valgrind warning in InnoDB compression code
Memcheck:Cond
fun:*
fun:*
fun:deflate
fun:btr_store_big_rec_extern_fields_func
fun:row_ins_index_entry_low
fun:row_ins_index_entry
fun:row_ins_index_entry_step
fun:row_ins
fun:row_ins_step
fun:row_insert_for_mysql
}
{
In page0zip.c we have already checked that the memory is initialized before calling deflate()
Memcheck:Cond
fun:*
fun:*
fun:deflate
fun:page_zip_compress
}
{
In page0zip.c we have already checked that the memory is initialized before calling deflate()
Memcheck:Cond
fun:*
fun:*
fun:deflate
fun:page_zip_compress_deflate
}
{ {
Bug 59875 Valgrind warning in buf0buddy.c Bug 59875 Valgrind warning in buf0buddy.c
Memcheck:Addr1 Memcheck:Addr1
......
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
...@@ -57,35 +58,11 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen) ...@@ -57,35 +58,11 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen)
} }
/*
Valgrind normally gives false alarms for zlib operations, in the form of
"conditional jump depends on uninitialised values" etc. The reason is
explained in the zlib FAQ (http://www.zlib.net/zlib_faq.html#faq36):
"That is intentional for performance reasons, and the output of deflate
is not affected."
Also discussed on a blog
(http://www.sirena.org.uk/log/2006/02/19/zlib-generating-valgrind-warnings/):
"...loop unrolling in the zlib library causes the mentioned
“Conditional jump or move depends on uninitialised value(s)”
warnings. These are safe since the results of the comparison are
subsequently ignored..."
"the results of the calculations are discarded by bounds checking done
after the loop exits"
Fix by initializing the memory allocated by zlib when running under Valgrind.
This fix is safe, since such memory is only used internally by zlib, so we
will not hide any bugs in mysql this way.
*/
void *my_az_allocator(void *dummy __attribute__((unused)), unsigned int items, void *my_az_allocator(void *dummy __attribute__((unused)), unsigned int items,
unsigned int size) unsigned int size)
{ {
return my_malloc(key_memory_my_compress_alloc, (size_t)items*(size_t)size, return my_malloc(key_memory_my_compress_alloc, (size_t)items*(size_t)size,
IF_VALGRIND(MY_ZEROFILL, MYF(0))); MYF(0));
} }
void my_az_free(void *dummy __attribute__((unused)), void *address) void my_az_free(void *dummy __attribute__((unused)), void *address)
......
...@@ -6649,7 +6649,7 @@ struct my_option my_long_options[]= ...@@ -6649,7 +6649,7 @@ struct my_option my_long_options[]=
Also disable by default on Windows, due to high overhead for checking .sym Also disable by default on Windows, due to high overhead for checking .sym
files. files.
*/ */
IF_VALGRIND(0,IF_WIN(0,1)), 0, 0, 0, 0, 0}, IF_WIN(0,1), 0, 0, 0, 0, 0},
{"sysdate-is-now", 0, {"sysdate-is-now", 0,
"Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. " "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. "
"Since 5.0, SYSDATE() returns a `dynamic' value different for different " "Since 5.0, SYSDATE() returns a `dynamic' value different for different "
...@@ -8664,12 +8664,16 @@ void set_server_version(char *buf, size_t size) ...@@ -8664,12 +8664,16 @@ void set_server_version(char *buf, size_t size)
{ {
bool is_log= opt_log || global_system_variables.sql_log_slow || opt_bin_log; bool is_log= opt_log || global_system_variables.sql_log_slow || opt_bin_log;
bool is_debug= IF_DBUG(!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"), 0); bool is_debug= IF_DBUG(!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"), 0);
bool is_valgrind= IF_VALGRIND(!strstr(MYSQL_SERVER_SUFFIX_STR, "-valgrind"), 0); const char *is_valgrind=
#ifdef HAVE_VALGRIND
!strstr(MYSQL_SERVER_SUFFIX_STR, "-valgrind") ? "-valgrind" :
#endif
"";
strxnmov(buf, size - 1, strxnmov(buf, size - 1,
MYSQL_SERVER_VERSION, MYSQL_SERVER_VERSION,
MYSQL_SERVER_SUFFIX_STR, MYSQL_SERVER_SUFFIX_STR,
IF_EMBEDDED("-embedded", ""), IF_EMBEDDED("-embedded", ""),
is_valgrind ? "-valgrind" : "", is_valgrind,
is_debug ? "-debug" : "", is_debug ? "-debug" : "",
is_log ? "-log" : "", is_log ? "-log" : "",
NullS); NullS);
......
...@@ -71,7 +71,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd) ...@@ -71,7 +71,7 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd)
s->in = 0; s->in = 0;
s->out = 0; s->out = 0;
s->back = EOF; s->back = EOF;
s->crc = crc32(0L, Z_NULL, 0); s->crc = 0;
s->transparent = 0; s->transparent = 0;
s->mode = 'r'; s->mode = 'r';
s->version = (unsigned char)az_magic[1]; /* this needs to be a define to version */ s->version = (unsigned char)az_magic[1]; /* this needs to be a define to version */
......
...@@ -330,9 +330,6 @@ buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_reg; ...@@ -330,9 +330,6 @@ buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_reg;
buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_ref; buf_pool_t::chunk_t::map *buf_pool_t::chunk_t::map_ref;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/** Disable resizing buffer pool to make assertion code not expensive. */
my_bool buf_disable_resize_buffer_pool_debug = TRUE;
/** This is used to insert validation operations in execution /** This is used to insert validation operations in execution
in the debug version */ in the debug version */
static Atomic_counter<size_t> buf_dbg_counter; static Atomic_counter<size_t> buf_dbg_counter;
......
...@@ -86,10 +86,6 @@ static struct ...@@ -86,10 +86,6 @@ static struct
ulint flush_pass; ulint flush_pass;
} page_cleaner; } page_cleaner;
#ifdef UNIV_DEBUG
my_bool innodb_page_cleaner_disabled_debug;
#endif /* UNIV_DEBUG */
/* @} */ /* @} */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
...@@ -2379,12 +2375,6 @@ static void buf_flush_page_cleaner() ...@@ -2379,12 +2375,6 @@ static void buf_flush_page_cleaner()
goto unemployed; goto unemployed;
} }
#ifdef UNIV_DEBUG
while (innodb_page_cleaner_disabled_debug && !buf_flush_sync_lsn &&
srv_shutdown_state == SRV_SHUTDOWN_NONE)
std::this_thread::sleep_for(std::chrono::milliseconds(100));
#endif /* UNIV_DEBUG */
#ifndef DBUG_OFF #ifndef DBUG_OFF
next: next:
#endif /* !DBUG_OFF */ #endif /* !DBUG_OFF */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -74,11 +74,6 @@ the blocks on free list. If LRU list is very small then we can end up ...@@ -74,11 +74,6 @@ the blocks on free list. If LRU list is very small then we can end up
in thrashing. */ in thrashing. */
#define BUF_LRU_MIN_LEN 256 #define BUF_LRU_MIN_LEN 256
# ifdef UNIV_DEBUG
extern my_bool buf_disable_resize_buffer_pool_debug; /*!< if TRUE, resizing
buffer pool is not allowed. */
# endif /* UNIV_DEBUG */
/** This structure defines information we will fetch from each buffer pool. It /** This structure defines information we will fetch from each buffer pool. It
will be used to print table IO stats */ will be used to print table IO stats */
struct buf_pool_info_t struct buf_pool_info_t
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1072,7 +1072,6 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown() ...@@ -1072,7 +1072,6 @@ ATTRIBUTE_COLD void logs_empty_and_mark_files_at_shutdown()
dict_stats_shutdown(); dict_stats_shutdown();
btr_defragment_shutdown(); btr_defragment_shutdown();
ut_d(srv_master_thread_enable());
srv_shutdown_state = SRV_SHUTDOWN_CLEANUP; srv_shutdown_state = SRV_SHUTDOWN_CLEANUP;
if (srv_buffer_pool_dump_at_shutdown && if (srv_buffer_pool_dump_at_shutdown &&
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment