summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-02-03 19:33:09 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-02-03 19:33:09 +0200
commite174d923d94bd183bef8ab6a1da3777ae738c945 (patch)
treeda9e3689895b07af7cd09be542947feabbf0a473
parent1d725c81769015b2a2e3d13296b0046f0eeb8065 (diff)
downloadmariadb-git-e174d923d94bd183bef8ab6a1da3777ae738c945.tar.gz
innodb.innodb-get-fk: Actually test --innodb-read-only.
-rw-r--r--mysql-test/include/restart_mysqld.inc9
-rw-r--r--mysql-test/suite/innodb/r/innodb-get-fk.result4
-rw-r--r--mysql-test/suite/innodb/t/innodb-get-fk.test10
3 files changed, 16 insertions, 7 deletions
diff --git a/mysql-test/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 71efb141917..dcaf47c55a2 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -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
diff --git a/mysql-test/suite/innodb/r/innodb-get-fk.result b/mysql-test/suite/innodb/r/innodb-get-fk.result
index 0dca82c2d10..f34fb8bcb67 100644
--- a/mysql-test/suite/innodb/r/innodb-get-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-get-fk.result
@@ -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` (
@@ -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` (
diff --git a/mysql-test/suite/innodb/t/innodb-get-fk.test b/mysql-test/suite/innodb/t/innodb-get-fk.test
index 4245bef289f..c1ab54fab45 100644
--- a/mysql-test/suite/innodb/t/innodb-get-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-get-fk.test
@@ -33,19 +33,20 @@ 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
#
@@ -53,6 +54,7 @@ SHOW CREATE TABLE `repro`.`crew_role_assigned`;
#
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
+-- let $restart_parameters=
-- source include/restart_mysqld.inc
DROP TABLE `repro`.`crew_role_assigned`;