| 1 |
--source include/have_innodb.inc |
| 2 |
--source include/default_charset.inc |
| 3 |
# need to restart server |
| 4 |
--source include/not_embedded.inc |
| 5 |
--source include/no_valgrind_without_big.inc |
| 6 |
|
| 7 |
CREATE SCHEMA `repro`; |
| 8 |
|
| 9 |
CREATE TABLE `repro`.`crew` ( |
| 10 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
| 11 |
`code` varchar(50) NOT NULL, |
| 12 |
`name` varchar(50) NOT NULL, |
| 13 |
`created_at` timestamp NULL DEFAULT NULL, |
| 14 |
`updated_at` timestamp NULL DEFAULT NULL, |
| 15 |
PRIMARY KEY (`id`), |
| 16 |
KEY `code` (`code`) |
| 17 |
) ENGINE=InnoDB; |
| 18 |
|
| 19 |
CREATE TABLE `repro`.`pilot` ( |
| 20 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
| 21 |
`code` varchar(50) NOT NULL, |
| 22 |
`name` varchar(50) NOT NULL, |
| 23 |
`created_at` timestamp NULL DEFAULT NULL, |
| 24 |
`updated_at` timestamp NULL DEFAULT NULL, |
| 25 |
PRIMARY KEY (`id`), |
| 26 |
KEY `code` (`code`) |
| 27 |
) ENGINE=InnoDB; |
| 28 |
|
| 29 |
CREATE TABLE `repro`.`crew_role_assigned` ( |
| 30 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
| 31 |
`crew_id` int(11) NOT NULL, |
| 32 |
`role_code` varchar(50) NOT NULL, |
| 33 |
PRIMARY KEY (`id`), |
| 34 |
KEY `fk_crewRoleAssigned_roleCode` (`role_code`), |
| 35 |
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, |
| 36 |
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
| 37 |
) ENGINE=InnoDB COMMENT="This is a comment about tables"; |
| 38 |
|
| 39 |
-- let $restart_parameters=--innodb-read-only |
| 40 |
-- source include/restart_mysqld.inc |
| 41 |
|
| 42 |
--error ER_OPEN_AS_READONLY |
| 43 |
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = 'innodb_read_only'; |
| 44 |
SHOW CREATE TABLE `repro`.`crew_role_assigned`; |
| 45 |
|
| 46 |
# These should be ignored in innodb_read_only mode. |
| 47 |
SET GLOBAL innodb_buffer_pool_load_now = ON; |
| 48 |
SET GLOBAL innodb_buffer_pool_dump_now = ON; |
| 49 |
SET GLOBAL innodb_buffer_pool_load_abort = ON; |
| 50 |
|
| 51 |
-- let $restart_parameters= |
| 52 |
-- source include/restart_mysqld.inc |
| 53 |
|
| 54 |
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables"; |
| 55 |
SHOW CREATE TABLE `repro`.`crew_role_assigned`; |
| 56 |
|
| 57 |
-- let $restart_parameters=--innodb-read-only |
| 58 |
-- source include/restart_mysqld.inc |
| 59 |
|
| 60 |
# |
| 61 |
# Below create table should contain also fk definitions |
| 62 |
# |
| 63 |
SHOW CREATE TABLE `repro`.`crew_role_assigned`; |
| 64 |
|
| 65 |
-- let $restart_parameters= |
| 66 |
-- source include/restart_mysqld.inc |
| 67 |
|
| 68 |
DROP TABLE `repro`.`crew_role_assigned`; |
| 69 |
DROP TABLE `repro`.`pilot`; |
| 70 |
DROP TABLE `repro`.`crew`; |
| 71 |
DROP SCHEMA `repro`; |