SET GLOBAL innodb_file_per_table = 1; SELECT @@innodb_file_per_table; @@innodb_file_per_table 1 SET GLOBAL innodb_file_format = `Barracuda`; SELECT @@innodb_file_format; @@innodb_file_format Barracuda set global innodb_large_prefix=1; SELECT @@innodb_large_prefix; @@innodb_large_prefix 1 DROP DATABASE IF EXISTS testdb_wl6445; CREATE DATABASE testdb_wl6445; case # 1 SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_format = `Barracuda`; USE testdb_wl6445; CREATE TABLE t1 ( i int PRIMARY KEY , j blob) ENGINE = InnoDB; INSERT INTO t1 VALUES (1,repeat('a',200)),(2,repeat('b',200)),(3,repeat('c',200)); SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc USE testdb_wl6445; SELECT i FROM t1 ORDER BY i; i 1 2 3 INSERT INTO t1 VALUES (11,repeat('a',200)),(12,repeat('b',200)),(13,repeat('c',200)); ERROR HY000: Can't lock file (errno: 165 - Table is read only) SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc INSERT INTO t1 VALUES (11,repeat('a',200)),(12,repeat('b',200)),(13,repeat('c',200)); ERROR HY000: Can't lock file (errno: 165 - Table is read only) SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc CREATE TABLE t2 ( i int , j blob) ENGINE = Innodb; ERROR HY000: InnoDB is in read only mode. UPDATE t1 SET i = i+1; ERROR HY000: Can't lock file (errno: 165 - Table is read only) FLUSH STATUS; FLUSH LOGS; FLUSH TABLES t1; FLUSH TABLES WITH READ LOCK; UNLOCK TABLES; DROP DATABASE IF EXISTS testdb_wl6445; case # 2 DROP DATABASE IF EXISTS testdb_wl6445; CREATE DATABASE testdb_wl6445; USE testdb_wl6445; CREATE TABLE t1 ( i int PRIMARY KEY , j blob) ENGINE = InnoDB; INSERT INTO t1 VALUES (1,repeat('a',200)),(2,repeat('b',200)),(3,repeat('c',200)); SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc CREATE TABLE t2 ( i int PRIMARY KEY , j blob) ENGINE = InnoDB; INSERT INTO t2 VALUES (1,repeat('a',200)),(2,repeat('b',200)),(3,repeat('c',200)); SELECT i,LEFT(j,20) FROM t2 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc UPDATE t2 SET i = i + 10; SELECT i,LEFT(j,20) FROM t2 ORDER BY i; i LEFT(j,20) 11 aaaaaaaaaaaaaaaaaaaa 12 bbbbbbbbbbbbbbbbbbbb 13 cccccccccccccccccccc DELETE FROM t2; SELECT i,LEFT(j,20) FROM t2 ORDER BY i; i LEFT(j,20) USE testdb_wl6445; SELECT i FROM t1 ORDER BY i; i 1 2 3 SELECT i FROM t2 ORDER BY i; i INSERT INTO t1 VALUES (11,repeat('a',200)),(12,repeat('b',200)),(13,repeat('c',200)); ERROR HY000: Can't lock file (errno: 165 - Table is read only) SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc INSERT INTO t1 VALUES (11,repeat('a',200)),(12,repeat('b',200)),(13,repeat('c',200)); ERROR HY000: Can't lock file (errno: 165 - Table is read only) SELECT i,LEFT(j,20) FROM t1 ORDER BY i; i LEFT(j,20) 1 aaaaaaaaaaaaaaaaaaaa 2 bbbbbbbbbbbbbbbbbbbb 3 cccccccccccccccccccc CREATE TABLE t2 ( i int , j blob) ENGINE = Innodb; ERROR 42S01: Table 't2' already exists CREATE TABLE t3 ( i int , j blob) ENGINE = Innodb; ERROR HY000: InnoDB is in read only mode. UPDATE t1 SET i = i+1; ERROR HY000: Can't lock file (errno: 165 - Table is read only) FLUSH STATUS; FLUSH LOGS; FLUSH TABLES t1,t2; FLUSH TABLES WITH READ LOCK; UNLOCK TABLES; case # 3 # Try to restart the server without --innodb-read-only after removing # write permissions of system tablespace. Server should not start. # This confirms server is not automatically started in read-only mode. USE testdb_wl6445; DROP DATABASE testdb_wl6445; SET GLOBAL INNODB_FILE_FORMAT=Antelope; SET GLOBAL INNODB_FILE_PER_TABLE=1; SET GLOBAL innodb_large_prefix = 0;