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

MDEV-14086 Setting innodb_buffer_pool_load_now or innodb_buffer_load_abort...

MDEV-14086 Setting innodb_buffer_pool_load_now or innodb_buffer_load_abort will crash if innodb_read_only

When MySQL 5.6.10 introduced innodb_read_only mode, it skipped the
creation of the InnoDB buffer pool dump/restore subsystem in that mode.
Attempts to set the variable innodb_buf_pool_dump_now would have
no effect in innodb_read_only mode, but the corresponding condition
was forgotten in from the other two update functions.

MySQL 5.7.20 would fix the innodb_buffer_pool_load_now,
but not innodb_buffer_pool_load_abort. Let us fix both in MariaDB.
parent 4090ef82
......@@ -40,6 +40,9 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a comment about tables'
SET GLOBAL innodb_buffer_pool_load_now = ON;
SET GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_load_abort = ON;
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table
......
......@@ -40,6 +40,11 @@ CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `rep
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
# These should be ignored in innodb_read_only mode.
SET GLOBAL innodb_buffer_pool_load_now = ON;
SET GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_load_abort = ON;
-- let $restart_parameters=
-- source include/restart_mysqld.inc
......
......@@ -16375,7 +16375,7 @@ buffer_pool_load_now(
const void* save) /*!< in: immediate result from
check function */
{
if (*(my_bool*) save) {
if (*(my_bool*) save && !srv_read_only_mode) {
buf_load_start();
}
}
......@@ -16398,7 +16398,7 @@ buffer_pool_load_abort(
const void* save) /*!< in: immediate result from
check function */
{
if (*(my_bool*) save) {
if (*(my_bool*) save && !srv_read_only_mode) {
buf_load_abort();
}
}
......
......@@ -17651,7 +17651,7 @@ buffer_pool_load_now(
const void* save) /*!< in: immediate result from
check function */
{
if (*(my_bool*) save) {
if (*(my_bool*) save && !srv_read_only_mode) {
buf_load_start();
}
}
......@@ -17674,7 +17674,7 @@ buffer_pool_load_abort(
const void* save) /*!< in: immediate result from
check function */
{
if (*(my_bool*) save) {
if (*(my_bool*) save && !srv_read_only_mode) {
buf_load_abort();
}
}
......
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