Skip to content

Commit

Permalink
innodb.innodb-get-fk: Actually test --innodb-read-only.
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Feb 3, 2017
1 parent 1d725c8 commit e174d92
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
9 changes: 8 additions & 1 deletion mysql-test/include/restart_mysqld.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ if ($shutdown_timeout == 0)
shutdown_server $server_shutdown_timeout;

# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $_expect_file_name
if ($restart_parameters)
{
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--exec echo "restart" > $_expect_file_name
}

# Turn on reconnect
--enable_reconnect
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb/r/innodb-get-fk.result
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB COMMENT="This is a comment about tables";
# Restart mysqld --innodb_read_only_mode=1
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
ERROR HY000: Can't lock file (errno: 165 "Table is read only")
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table
crew_role_assigned CREATE TABLE `crew_role_assigned` (
Expand All @@ -52,7 +53,6 @@ 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 new comment about tables'
# Restart mysqld --innodb_read_only_mode=1
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table
crew_role_assigned CREATE TABLE `crew_role_assigned` (
Expand Down
10 changes: 6 additions & 4 deletions mysql-test/suite/innodb/t/innodb-get-fk.test
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,28 @@ CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repr
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB COMMENT="This is a comment about tables";

--echo # Restart mysqld --innodb_read_only_mode=1
-- let $restart_parameters=--innodb-read-only-mode=1
-- let $restart_parameters=--innodb-read-only
-- source include/restart_mysqld.inc

--error ER_CANT_LOCK
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
SHOW CREATE TABLE `repro`.`crew_role_assigned`;

-- let $restart_parameters=
-- source include/restart_mysqld.inc

ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
SHOW CREATE TABLE `repro`.`crew_role_assigned`;

--echo # Restart mysqld --innodb_read_only_mode=1
-- let $restart_parameters=--innodb-read-only-mode=1
-- let $restart_parameters=--innodb-read-only
-- source include/restart_mysqld.inc

#
# Below create table should contain also fk definitions
#
SHOW CREATE TABLE `repro`.`crew_role_assigned`;

-- let $restart_parameters=
-- source include/restart_mysqld.inc

DROP TABLE `repro`.`crew_role_assigned`;
Expand Down

0 comments on commit e174d92

Please sign in to comment.