Skip to content

Commit e174d92

Browse files
committed
innodb.innodb-get-fk: Actually test --innodb-read-only.
1 parent 1d725c8 commit e174d92

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

mysql-test/include/restart_mysqld.inc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ if ($shutdown_timeout == 0)
3535
shutdown_server $server_shutdown_timeout;
3636

3737
# Write file to make mysql-test-run.pl start up the server again
38-
--exec echo "restart" > $_expect_file_name
38+
if ($restart_parameters)
39+
{
40+
--exec echo "restart: $restart_parameters" > $_expect_file_name
41+
}
42+
if (!$restart_parameters)
43+
{
44+
--exec echo "restart" > $_expect_file_name
45+
}
3946

4047
# Turn on reconnect
4148
--enable_reconnect

mysql-test/suite/innodb/r/innodb-get-fk.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
2626
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
2727
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
2828
) ENGINE=InnoDB COMMENT="This is a comment about tables";
29-
# Restart mysqld --innodb_read_only_mode=1
29+
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
30+
ERROR HY000: Can't lock file (errno: 165 "Table is read only")
3031
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
3132
Table Create Table
3233
crew_role_assigned CREATE TABLE `crew_role_assigned` (
@@ -52,7 +53,6 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
5253
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
5354
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
5455
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
55-
# Restart mysqld --innodb_read_only_mode=1
5656
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
5757
Table Create Table
5858
crew_role_assigned CREATE TABLE `crew_role_assigned` (

mysql-test/suite/innodb/t/innodb-get-fk.test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,28 @@ CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repr
3333
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
3434
) ENGINE=InnoDB COMMENT="This is a comment about tables";
3535

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

39+
--error ER_CANT_LOCK
40+
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only';
4041
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
4142

43+
-- let $restart_parameters=
4244
-- source include/restart_mysqld.inc
4345

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

47-
--echo # Restart mysqld --innodb_read_only_mode=1
48-
-- let $restart_parameters=--innodb-read-only-mode=1
49+
-- let $restart_parameters=--innodb-read-only
4950
-- source include/restart_mysqld.inc
5051

5152
#
5253
# Below create table should contain also fk definitions
5354
#
5455
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
5556

57+
-- let $restart_parameters=
5658
-- source include/restart_mysqld.inc
5759

5860
DROP TABLE `repro`.`crew_role_assigned`;

0 commit comments

Comments
 (0)