Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
SET @b=REPEAT('0',1048576);
CREATE TEMPORARY TABLE t (c MEDIUMTEXT) ENGINE=InnoDB;
INSERT INTO t VALUES
(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b);
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
SET GLOBAL innodb_buffer_pool_size=6291456;
SET GLOBAL innodb_buffer_pool_size=16777216;
CHECKSUM TABLE t;
Table Checksum
test.t 4050893687
DROP TEMPORARY TABLE t;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--innodb-buffer-pool-size=16m
20 changes: 20 additions & 0 deletions mysql-test/suite/innodb/t/innodb_buffer_pool_shrink_temporary.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--source include/have_innodb.inc
call mtr.add_suppression("innodb_buffer_pool_size change aborted");
SET @b=REPEAT('0',1048576);
CREATE TEMPORARY TABLE t (c MEDIUMTEXT) ENGINE=InnoDB;
INSERT INTO t VALUES
(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b);
--error 0,ER_WRONG_USAGE
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
--error 0,ER_WRONG_USAGE
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
--error 0,ER_WRONG_USAGE
SET STATEMENT max_statement_time=0.000001 FOR
SET GLOBAL innodb_buffer_pool_size=6291456;
--error 0,ER_WRONG_USAGE
SET GLOBAL innodb_buffer_pool_size=6291456;
SET GLOBAL innodb_buffer_pool_size=16777216;
CHECKSUM TABLE t;
DROP TEMPORARY TABLE t;
8 changes: 7 additions & 1 deletion storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,11 @@ ATTRIBUTE_COLD buf_pool_t::shrink_status buf_pool_t::shrink(size_t size)
buf_flush_relocate_on_flush_list(b, &block->page);
mysql_mutex_unlock(&flush_list_mutex);
}
else
{
ut_d(if (auto om= b->oldest_modification()) ut_ad(om == 2));
b->oldest_modification_.store(0, std::memory_order_relaxed);
}
}

/* relocate LRU list */
Expand Down Expand Up @@ -2091,10 +2096,11 @@ ATTRIBUTE_COLD void buf_pool_t::resize(size_t size, THD *thd) noexcept

while (buf_page_t *b= UT_LIST_GET_FIRST(withdrawn))
{
ut_ad(!b->oldest_modification());
ut_ad(b->state() == buf_page_t::NOT_USED);
UT_LIST_REMOVE(withdrawn, b);
UT_LIST_ADD_LAST(free, b);
ut_d(b->in_free_list= true);
ut_ad(b->state() == buf_page_t::NOT_USED);
b->lock.init();
}

Expand Down