summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-10 17:21:16 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-11 11:15:11 +0200
commit9bc874a594edbc0e124131d0ff30b44f5fade52d (patch)
tree38fd225df9573771fe967174e07151721663b3cd /mysql-test
parentc498250888ec126fddda2867d1239b2a7734482f (diff)
downloadmariadb-git-9bc874a594edbc0e124131d0ff30b44f5fade52d.tar.gz
MDEV-23497 Make ROW_FORMAT=COMPRESSED read-only by default
Let us introduce the parameter innodb_read_only_compressed that is ON by default, making any ROW_FORMAT=COMPRESSED tables read-only. I developed the ROW_FORMAT=COMPRESSED format based on Heikki Tuuri's rough design between 2005 and 2008. It might have been a good idea back then, but no proper benchmarks were ever run to validate the design or the implementation. The format has been more or less obsolete for years. It limits innodb_page_size to 16384 bytes (the default), and instant ALTER TABLE is not supported. This is the first step towards deprecating and removing write support for ROW_FORMAT=COMPRESSED tables.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/innodb_page_size.combinations3
-rw-r--r--mysql-test/include/innodb_page_size_small.combinations3
-rw-r--r--mysql-test/main/partition_innodb_plugin.test8
-rw-r--r--mysql-test/suite/encryption/include/have_example_key_management_plugin.opt1
-rw-r--r--mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations2
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_basic.test7
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_blob.test11
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.test7
-rw-r--r--mysql-test/suite/innodb/r/default_row_format_compatibility.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_blob_truncate.result17
-rw-r--r--mysql-test/suite/innodb/r/temp_table.result2
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result46
-rw-r--r--mysql-test/suite/innodb/t/alter_algorithm.combinations4
-rw-r--r--mysql-test/suite/innodb/t/alter_key_block_size-11757.test7
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_compatibility.test12
-rw-r--r--mysql-test/suite/innodb/t/default_row_format_create.test7
-rw-r--r--mysql-test/suite/innodb/t/file_format_defaults.test9
-rw-r--r--mysql-test/suite/innodb/t/index_merge_threshold.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-16k-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb-online-alter-gis.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzma.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzo.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_zip.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb_blob_truncate.test32
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_bugs.test8
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_null.test10
-rw-r--r--mysql-test/suite/innodb/t/readahead.test3
-rw-r--r--mysql-test/suite/innodb/t/table_flags.opt1
-rw-r--r--mysql-test/suite/innodb/t/temp_table.test2
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test26
-rw-r--r--mysql-test/suite/innodb/t/truncate.test7
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc.test9
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test7
-rw-r--r--mysql-test/suite/innodb_gis/t/create_spatial_index.test7
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result68
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result2
-rw-r--r--mysql-test/suite/innodb_zip/t/cmp_per_index.test7
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix.test6
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test17
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test6
-rw-r--r--mysql-test/suite/innodb_zip/t/large_blob.test7
-rw-r--r--mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test8
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test23
-rw-r--r--mysql-test/suite/parts/t/partition_alter_innodb.test7
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test7
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test4
61 files changed, 351 insertions, 167 deletions
diff --git a/mysql-test/include/innodb_page_size.combinations b/mysql-test/include/innodb_page_size.combinations
index b9b1e1b106f..e009b9ef3ab 100644
--- a/mysql-test/include/innodb_page_size.combinations
+++ b/mysql-test/include/innodb_page_size.combinations
@@ -8,9 +8,12 @@ innodb-buffer-pool-size=24M
[16k]
innodb-page-size=16K
+--skip-innodb-read-only-compressed
[8k]
innodb-page-size=8K
+--skip-innodb-read-only-compressed
[4k]
innodb-page-size=4K
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/include/innodb_page_size_small.combinations b/mysql-test/include/innodb_page_size_small.combinations
index a9b7c7ce14d..f181863603a 100644
--- a/mysql-test/include/innodb_page_size_small.combinations
+++ b/mysql-test/include/innodb_page_size_small.combinations
@@ -1,8 +1,11 @@
[16k]
innodb-page-size=16K
+skip-innodb-read-only-compressed
[8k]
innodb-page-size=8K
+skip-innodb-read-only-compressed
[4k]
innodb-page-size=4K
+skip-innodb-read-only-compressed
diff --git a/mysql-test/main/partition_innodb_plugin.test b/mysql-test/main/partition_innodb_plugin.test
index 74e1747746b..6d379b11756 100644
--- a/mysql-test/main/partition_innodb_plugin.test
+++ b/mysql-test/main/partition_innodb_plugin.test
@@ -41,9 +41,12 @@ SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
SET @@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--connect(con1,localhost,root,,)
-
CREATE TABLE t1 (id INT NOT NULL
PRIMARY KEY,
user_num CHAR(10)
@@ -90,6 +93,9 @@ DROP TABLE t1;
--connection default
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
#
# Bug#32430 - show engine innodb status causes errors
diff --git a/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt b/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt
index ce7f1ddef7e..2c04c73baec 100644
--- a/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt
+++ b/mysql-test/suite/encryption/include/have_example_key_management_plugin.opt
@@ -1,2 +1,3 @@
--plugin-load-add=$EXAMPLE_KEY_MANAGEMENT_SO
--loose-example-key-management
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations b/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations
index 4f6317cdf67..2302dc48da8 100644
--- a/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations
+++ b/mysql-test/suite/encryption/include/have_file_key_management_plugin.combinations
@@ -3,9 +3,11 @@ plugin-load-add=$FILE_KEY_MANAGEMENT_SO
loose-file-key-management
loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
file-key-management-encryption-algorithm=aes_cbc
+--skip-innodb-read-only-compressed
[ctr]
plugin-load-add=$FILE_KEY_MANAGEMENT_SO
loose-file-key-management
loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
file-key-management-encryption-algorithm=aes_ctr
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
index 00b942739b0..87251ad7d52 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
@@ -733,7 +733,14 @@ let $row_format=REDUNDANT;
--source inc/innodb_v_large_col.inc
let $row_format=COMPRESSED;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--source inc/innodb_v_large_col.inc
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
# Make sure FTS_DOC_ID for FULLTEXT index set with correct column id with
# virtual columns
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_blob.test b/mysql-test/suite/gcol/t/innodb_virtual_blob.test
index a97992d81e7..e94d2c7789a 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_blob.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_blob.test
@@ -5,6 +5,11 @@
--echo # BTR_COPY_BLOB_PREFIX
--echo #
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
CREATE TABLE t1
( f1 int primary key, f2 blob,
f3 blob generated always as (f2))
@@ -12,5 +17,9 @@ CREATE TABLE t1
insert into t1 (f1, f2) values (1, repeat('&', 50000));
alter table t1 add index i1 (f3(200)) ;
alter table t1 row_format=compact;
-drop table t1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
+
+drop table t1;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test
index 353841840dc..9886378ced1 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_index.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test
@@ -253,6 +253,10 @@ SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1(
a VARCHAR(1000) GENERATED ALWAYS AS ('1') VIRTUAL,
b VARCHAR(1000) NOT NULL,
@@ -262,6 +266,9 @@ CREATE TABLE t1(
) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1(b) VALUES(REPEAT('b',1000));
DELETE FROM t1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
--echo #
diff --git a/mysql-test/suite/innodb/r/default_row_format_compatibility.result b/mysql-test/suite/innodb/r/default_row_format_compatibility.result
index 5070fa33a2e..2889e86f82e 100644
--- a/mysql-test/suite/innodb/r/default_row_format_compatibility.result
+++ b/mysql-test/suite/innodb/r/default_row_format_compatibility.result
@@ -85,11 +85,20 @@ tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_for
SELECT * FROM tab;
a b
1 Check with max column size
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=ON;
ALTER TABLE tab ROW_FORMAT=COMPRESSED;
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+SET GLOBAL innodb_read_only_compressed=OFF;
+ALTER TABLE tab ROW_FORMAT=COMPRESSED;
+SET GLOBAL innodb_read_only_compressed=ON;
SELECT * FROM tab;
a b
1 Check with max column size
ALTER TABLE tab ROW_FORMAT=Dynamic;
+Warnings:
+Warning 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
SHOW TABLE STATUS LIKE 'tab';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
tab InnoDB # Dynamic # # # # # # NULL # NULL NULL latin1_swedish_ci NULL row_format=DYNAMIC 0 N
diff --git a/mysql-test/suite/innodb/r/innodb-32k.result b/mysql-test/suite/innodb/r/innodb-32k.result
index 8b67dac8237..184d7fde052 100644
--- a/mysql-test/suite/innodb/r/innodb-32k.result
+++ b/mysql-test/suite/innodb/r/innodb-32k.result
@@ -29,7 +29,7 @@ c71 char(200), c72 char(200), c73 char(200), c74 char(200), c75 char(200),
c76 char(200), c77 char(200), c78 char(200), c79 char(200), c80 char(200),
c81 char(63)
) ROW_FORMAT=compressed;
-ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
+Got one of the listed errors
CREATE TABLE t1 (a varchar(255) character set utf8,
b varchar(255) character set utf8,
c varchar(255) character set utf8,
diff --git a/mysql-test/suite/innodb/r/innodb_blob_truncate.result b/mysql-test/suite/innodb/r/innodb_blob_truncate.result
deleted file mode 100644
index b10d4a94eb7..00000000000
--- a/mysql-test/suite/innodb/r/innodb_blob_truncate.result
+++ /dev/null
@@ -1,17 +0,0 @@
-create table t1(a blob) engine=innodb key_block_size=8;
-create function generate_blob()
-returns varchar(20000)
-begin
-declare x varchar(20000) default '';
-declare i int default 500;
-while i > 0 do
-set x = concat(sha1(i), x);
-set i = i - 1;
-end while;
-return x;
-end //
-insert into t1 select generate_blob();
-truncate t1;
-insert into t1 select generate_blob();
-drop table t1;
-drop function generate_blob;
diff --git a/mysql-test/suite/innodb/r/temp_table.result b/mysql-test/suite/innodb/r/temp_table.result
index e90da0d5e77..dea47787a52 100644
--- a/mysql-test/suite/innodb/r/temp_table.result
+++ b/mysql-test/suite/innodb/r/temp_table.result
@@ -199,7 +199,7 @@ create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 4;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index 871c4c62446..732f369c402 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -164,11 +164,11 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
create temporary table t (
i int)
engine = innodb row_format = compressed;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
create temporary table t (
i int)
engine = innodb row_format = compressed key_block_size = 8;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
create temporary table t (
i int)
engine = innodb row_format = dynamic;
@@ -201,7 +201,7 @@ drop table t;
create temporary table t (
i int)
engine = innodb row_format = compressed;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
#files in MYSQL_TMP_DIR, expecting only default temporary tablespace file
ibtmp1
create temporary table t (
@@ -473,19 +473,19 @@ CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB KEY_BLOCK_SIZE = 4;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB KEY_BLOCK_SIZE = 4, ROW_FORMAT = COMPACT;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
@@ -505,37 +505,37 @@ CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB KEY_BLOCK_SIZE = 4;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB ROW_FORMAT = COMPRESSED;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB ROW_FORMAT = COMPRESSED KEY_BLOCK_SIZE = 8;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
) ENGINE = InnoDB ROW_FORMAT = COMPRESSED KEY_BLOCK_SIZE = 7;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
@@ -555,22 +555,22 @@ CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY
) ENGINE = InnoDB ROW_FORMAT = REDUNDANT;
ALTER TABLE t1 ROW_FORMAT = COMPRESSED;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
ALTER TABLE t1 KEY_BLOCK_SIZE = 4;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
ALTER TABLE t1 ROW_FORMAT = DYNAMIC KEY_BLOCK_SIZE = 4;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
ALTER TABLE t1 ROW_FORMAT = DYNAMIC;
set innodb_strict_mode = OFF;
@@ -613,10 +613,10 @@ Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
set innodb_strict_mode = ON;
ALTER TABLE t1 ADD COLUMN j INT;
-ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
SHOW WARNINGS;
Level Code Message
-Error 4047 CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+Error 4047 InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SHOW CREATE TABLE t1;
Table Create Table
diff --git a/mysql-test/suite/innodb/t/alter_algorithm.combinations b/mysql-test/suite/innodb/t/alter_algorithm.combinations
index 197748d168e..af644d65ec5 100644
--- a/mysql-test/suite/innodb/t/alter_algorithm.combinations
+++ b/mysql-test/suite/innodb/t/alter_algorithm.combinations
@@ -1,11 +1,15 @@
[COPY]
--alter_algorithm=copy
+--skip-innodb-read-only-compressed
[INPLACE]
--alter_algorithm=inplace
+--skip-innodb-read-only-compressed
[NOCOPY]
--alter_algorithm=nocopy
+--skip-innodb-read-only-compressed
[INSTANT]
--alter_algorithm=instant
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/alter_key_block_size-11757.test b/mysql-test/suite/innodb/t/alter_key_block_size-11757.test
index c11da6e8cc5..6eb81210eb5 100644
--- a/mysql-test/suite/innodb/t/alter_key_block_size-11757.test
+++ b/mysql-test/suite/innodb/t/alter_key_block_size-11757.test
@@ -2,6 +2,10 @@
# MDEV-11757 KEY_BLOCK_SIZE strangeness when UNCOMPRESSing COMPRESSed InnoDB tables
#
source include/have_innodb.inc;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
create table t1 (
id1 bigint(20) not null,
@@ -17,6 +21,9 @@ SET innodb_strict_mode=OFF;
alter table t1 row_format=dynamic;
show create table t1;
SET innodb_strict_mode=ON;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
alter table t1 key_block_size=0;
show create table t1;
alter table t1 drop primary key, add primary key (id1),
diff --git a/mysql-test/suite/innodb/t/default_row_format_compatibility.test b/mysql-test/suite/innodb/t/default_row_format_compatibility.test
index 3dea78b2ff0..41abc2e67bc 100644
--- a/mysql-test/suite/innodb/t/default_row_format_compatibility.test
+++ b/mysql-test/suite/innodb/t/default_row_format_compatibility.test
@@ -147,14 +147,22 @@ SHOW TABLE STATUS LIKE 'tab';
# Check by SELECT, no errors
SELECT * FROM tab;
-# Check no errors
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=ON;
+
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
+ALTER TABLE tab ROW_FORMAT=COMPRESSED;
+SET GLOBAL innodb_read_only_compressed=OFF;
ALTER TABLE tab ROW_FORMAT=COMPRESSED;
+SET GLOBAL innodb_read_only_compressed=ON;
# Check by SELECT, no errors
SELECT * FROM tab;
-# Check no errors
ALTER TABLE tab ROW_FORMAT=Dynamic;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+
+# Check no errors
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
SHOW TABLE STATUS LIKE 'tab';
diff --git a/mysql-test/suite/innodb/t/default_row_format_create.test b/mysql-test/suite/innodb/t/default_row_format_create.test
index 03a7ebd3752..acb6d477cda 100644
--- a/mysql-test/suite/innodb/t/default_row_format_create.test
+++ b/mysql-test/suite/innodb/t/default_row_format_create.test
@@ -21,6 +21,10 @@ CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
SHOW TABLE STATUS LIKE 't1';
DROP TABLE t1;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1(c1 TEXT,c2 BLOB) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
@@ -28,6 +32,9 @@ SHOW TABLE STATUS LIKE 't1';
TRUNCATE TABLE t1;
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 #
SHOW TABLE STATUS LIKE 't1';
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
--error 0,ER_CANT_CREATE_TABLE
diff --git a/mysql-test/suite/innodb/t/file_format_defaults.test b/mysql-test/suite/innodb/t/file_format_defaults.test
index 5c7c617cb52..f648610f47f 100644
--- a/mysql-test/suite/innodb/t/file_format_defaults.test
+++ b/mysql-test/suite/innodb/t/file_format_defaults.test
@@ -14,6 +14,11 @@ SELECT @@innodb_file_per_table;
SET SQL_MODE=strict_all_tables;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
CREATE TABLE tab0 (c1 VARCHAR(65530), KEY(c1(3073))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SHOW CREATE TABLE tab0;
DROP TABLE tab0;
@@ -33,3 +38,7 @@ SELECT @@innodb_strict_mode;
CREATE TABLE tab1(c1 int ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
DROP TABLE tab1;
+
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
diff --git a/mysql-test/suite/innodb/t/index_merge_threshold.opt b/mysql-test/suite/innodb/t/index_merge_threshold.opt
index 56434e883de..ad0f33c3f1e 100644
--- a/mysql-test/suite/innodb/t/index_merge_threshold.opt
+++ b/mysql-test/suite/innodb/t/index_merge_threshold.opt
@@ -1 +1,2 @@
--loose-innodb_sys_tablespaces
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/innodb-16k-master.opt b/mysql-test/suite/innodb/t/innodb-16k-master.opt
index a99075f5329..6532d092a55 100644
--- a/mysql-test/suite/innodb/t/innodb-16k-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-16k-master.opt
@@ -1 +1,2 @@
--default_storage_engine=InnoDB
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/innodb-32k.test b/mysql-test/suite/innodb/t/innodb-32k.test
index a9645d65998..983ba88370a 100644
--- a/mysql-test/suite/innodb/t/innodb-32k.test
+++ b/mysql-test/suite/innodb/t/innodb-32k.test
@@ -20,7 +20,7 @@ SELECT variable_value FROM information_schema.global_status
SET SESSION innodb_strict_mode = ON;
--replace_regex /> [0-9]*/> max_row_size/
---error 1005
+--error ER_CANT_CREATE_TABLE,ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index f72935ebc3c..70174a98d77 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -617,6 +617,10 @@ eval DROP DATABASE $dest_db;
--echo # ORPHANED DUE TO RENAME TABLE
--echo #
CREATE DATABASE db1; USE db1;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE notes (
id int(11) NOT NULL AUTO_INCREMENT,
body text COLLATE utf8_unicode_ci,
@@ -627,6 +631,9 @@ ROW_FORMAT=COMPRESSED;
ALTER TABLE notes ADD FULLTEXT INDEX index_ft_body (body(255));
DROP INDEX index_ft_body ON notes;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
CREATE DATABASE db2;
RENAME TABLE db1.notes TO db2.notes;
diff --git a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
index 1c99c6eeb9d..df0ab2e8184 100644
--- a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
+++ b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
@@ -35,6 +35,10 @@ DROP TABLE t1;
--echo # BTR_COPY_BLOB_PREFIX
--echo #
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1(f1 INT PRIMARY KEY, f3 LINESTRING NOT NULL,
SPATIAL KEY(f3))ENGINE=InnoDB ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=1;
@@ -58,5 +62,7 @@ let $linestr = $linestr 9999 9999);
--eval INSERT INTO t1 VALUES (1, ST_linefromtext(concat('linestring', '$linestr')));
ALTER TABLE t1 ROW_FORMAT = DYNAMIC, KEY_BLOCK_SIZE=0, ALGORITHM=INPLACE;
-
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
index 2b4a9ea22a9..391548d3e0c 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
@@ -5,6 +5,10 @@
# bzip2
set global innodb_compression_algorithm = 5;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
index 49255d3a1ac..828fc978a29 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -5,6 +5,10 @@
# lz4
set global innodb_compression_algorithm = 2;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
index e05c08f7515..7fbe17d6206 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
@@ -5,6 +5,10 @@
# lzma
set global innodb_compression_algorithm = 4;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
index af831bd2467..91e966415b6 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
@@ -5,6 +5,10 @@
# lzo
set global innodb_compression_algorithm = 3;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
index ad78767e903..c0079a0dab3 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
@@ -6,6 +6,10 @@
# zlib
set global innodb_compression_algorithm = 1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
show warnings;
create table innodb_normal (c1 int, b char(20)) engine=innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index 204c71ef3f1..7675a1305a4 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -552,7 +552,10 @@ ib_unlink_tablespace("test", "t1");
EOF
DROP TABLE t1;
-
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
@@ -1071,6 +1074,9 @@ SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'");
diff --git a/mysql-test/suite/innodb/t/innodb_blob_truncate.test b/mysql-test/suite/innodb/t/innodb_blob_truncate.test
deleted file mode 100644
index 3e54ec80e2b..00000000000
--- a/mysql-test/suite/innodb/t/innodb_blob_truncate.test
+++ /dev/null
@@ -1,32 +0,0 @@
---source include/have_innodb.inc
---source include/have_innodb_16k.inc
-
-create table t1(a blob) engine=innodb key_block_size=8;
-delimiter //;
-create function generate_blob()
- returns varchar(20000)
- begin
- declare x varchar(20000) default '';
- declare i int default 500;
- while i > 0 do
- set x = concat(sha1(i), x);
- set i = i - 1;
- end while;
- return x;
-end //
-delimiter ;//
-insert into t1 select generate_blob();
-let $x = `select 20000 - length(a) from t1`;
-if ($x) {
- echo Blob is truncated by $x bytes.;
- die It must have been 20000 bytes.;
-}
-truncate t1;
-insert into t1 select generate_blob();
-let $x = `select 20000 - length(a) from t1`;
-if ($x) {
- echo Blob is truncated by $x bytes.;
- die It must have been 20000 bytes.;
-}
-drop table t1;
-drop function generate_blob;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
index 77fdb49a57d..1370ee6c0fc 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test
@@ -33,6 +33,10 @@ set global innodb_buffer_pool_size = 10485760;
select @@innodb_buffer_pool_size;
# fill buffer pool
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
create or replace view view0 as select 1 union all select 1;
@@ -41,6 +45,9 @@ set @`v_val` := 0;
# 2^18 == 262144 records
replace into t1 select (@`v_id` := (@`v_id` + 4) mod 4294967296) as id, (@`v_val` := (@`v_val` + 4) mod 4294967296) as val from view0 v0, view0 v1, view0 v2, view0 v3, view0 v4, view0 v5, view0 v6, view0 v7, view0 v8, view0 v9, view0 v10, view0 v11, view0 v12, view0 v13, view0 v14, view0 v15, view0 v16, view0 v17;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
# Shrink buffer pool
set global innodb_buffer_pool_size = 7340032;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
index b04b0306bf1..36d6bd739b3 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_with_chunks.test
@@ -24,6 +24,10 @@ if (`select (version() like '%debug%') > 0`)
select @@innodb_buffer_pool_chunk_size;
# fill buffer pool
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
create or replace view view0 as select 1 union all select 1;
@@ -32,6 +36,9 @@ set @`v_val` := 0;
# 2^18 == 262144 records
replace into t1 select (@`v_id` := (@`v_id` + 4) mod 4294967296) as id, (@`v_val` := (@`v_val` + 4) mod 4294967296) as val from view0 v0, view0 v1, view0 v2, view0 v3, view0 v4, view0 v5, view0 v6, view0 v7, view0 v8, view0 v9, view0 v10, view0 v11, view0 v12, view0 v13, view0 v14, view0 v15, view0 v16, view0 v17;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
# Shrink buffer pool to 7MB
set global innodb_buffer_pool_size = 7340032;
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt
index 587a2d7e6c1..05d6c5f9435 100644
--- a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt
@@ -2,3 +2,4 @@
--innodb_buffer_pool_size=32M
--skip-innodb-stats-persistent
--innodb-sys-tablestats
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt
index 1a8442b841f..1c11f5f2add 100644
--- a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt
+++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt
@@ -2,3 +2,4 @@
--innodb_buffer_pool_size=32M
--skip-innodb-stats-persistent
--innodb-sys-tablestats
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
index 39b205c9b68..7268883b902 100644
--- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures-master.opt
@@ -1,2 +1,3 @@
--innodb-file-per-table
--skip-innodb-doublewrite
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt
index fae32059249..9a9a4a17067 100644
--- a/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_simulate_comp_failures_small-master.opt
@@ -1,2 +1,2 @@
--innodb-file-per-table
-
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test
index ec9f609138c..03465ee86ee 100644
--- a/mysql-test/suite/innodb/t/instant_alter_bugs.test
+++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test
@@ -210,7 +210,10 @@ SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.3 tests
-
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
create table t (
a varchar(9),
b int,
@@ -225,6 +228,9 @@ alter table t modify a varchar(10), algorithm=instant;
alter table t change b bb int, algorithm=instant;
alter table t modify c int without system versioning, algorithm=instant;
set @@system_versioning_alter_history = error;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
check table t;
drop table t;
diff --git a/mysql-test/suite/innodb/t/instant_alter_null.test b/mysql-test/suite/innodb/t/instant_alter_null.test
index 69fb1ae4495..34f47ed9c07 100644
--- a/mysql-test/suite/innodb/t/instant_alter_null.test
+++ b/mysql-test/suite/innodb/t/instant_alter_null.test
@@ -1,8 +1,18 @@
--source include/have_innodb.inc
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
create table t (a int NOT NULL) engine=innodb row_format= compressed;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t modify a int NULL, algorithm=instant;
+
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
+
drop table t;
create table t (a int NOT NULL) engine=innodb row_format= dynamic;
diff --git a/mysql-test/suite/innodb/t/readahead.test b/mysql-test/suite/innodb/t/readahead.test
index b4b8e8e38f0..d7063442b1b 100644
--- a/mysql-test/suite/innodb/t/readahead.test
+++ b/mysql-test/suite/innodb/t/readahead.test
@@ -6,6 +6,9 @@
--echo # Bug#25330449 ASSERT SIZE==SPACE->SIZE DURING BUF_READ_AHEAD_RANDOM
let $MYSQLD_DATADIR=`SELECT @@datadir`;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=INNODB ROW_FORMAT=COMPRESSED;
--source include/shutdown_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/table_flags.opt b/mysql-test/suite/innodb/t/table_flags.opt
index c44c611ed60..bca674950d2 100644
--- a/mysql-test/suite/innodb/t/table_flags.opt
+++ b/mysql-test/suite/innodb/t/table_flags.opt
@@ -1 +1,2 @@
--innodb-checksum-algorithm=crc32
+--skip-innodb-read-only-compressed
diff --git a/mysql-test/suite/innodb/t/temp_table.test b/mysql-test/suite/innodb/t/temp_table.test
index 4809f278fb6..0fdcb6c678a 100644
--- a/mysql-test/suite/innodb/t/temp_table.test
+++ b/mysql-test/suite/innodb/t/temp_table.test
@@ -23,7 +23,7 @@ create temporary table t2
--source suite/innodb/include/dml_ops.inc
drop temporary table t1,t2;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index 389e106a345..f5006c82549 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -181,12 +181,12 @@ eval $check_no_innodb;
--let $restart_parameters=
--source include/restart_mysqld.inc
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
create temporary table t (
i int)
engine = innodb row_format = compressed;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
create temporary table t (
i int)
engine = innodb row_format = compressed key_block_size = 8;
@@ -211,7 +211,7 @@ show warnings;
set innodb_strict_mode = default;
#
drop table t;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
create temporary table t (
i int)
engine = innodb row_format = compressed;
@@ -344,7 +344,7 @@ DROP TABLE t1;
# Set innodb_strict_mode=ON and test compressed temporary tables again.
set innodb_strict_mode = ON;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -352,7 +352,7 @@ CREATE TEMPORARY TABLE t1 (
SHOW WARNINGS;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -369,7 +369,7 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -377,7 +377,7 @@ CREATE TEMPORARY TABLE t1 (
SHOW WARNINGS;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -385,7 +385,7 @@ CREATE TEMPORARY TABLE t1 (
SHOW WARNINGS;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -393,7 +393,7 @@ CREATE TEMPORARY TABLE t1 (
SHOW WARNINGS;
#
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY,
c CHAR(10) NOT NULL
@@ -414,15 +414,15 @@ CREATE TEMPORARY TABLE t1 (
i INT NOT NULL PRIMARY KEY
) ENGINE = InnoDB ROW_FORMAT = REDUNDANT;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
ALTER TABLE t1 ROW_FORMAT = COMPRESSED;
SHOW WARNINGS;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
ALTER TABLE t1 KEY_BLOCK_SIZE = 4;
SHOW WARNINGS;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
ALTER TABLE t1 ROW_FORMAT = DYNAMIC KEY_BLOCK_SIZE = 4;
SHOW WARNINGS;
@@ -450,7 +450,7 @@ SHOW WARNINGS;
set innodb_strict_mode = ON;
---error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
ALTER TABLE t1 ADD COLUMN j INT;
SHOW WARNINGS;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/innodb/t/truncate.test b/mysql-test/suite/innodb/t/truncate.test
index ca9ccb677e9..80b10cd8ca5 100644
--- a/mysql-test/suite/innodb/t/truncate.test
+++ b/mysql-test/suite/innodb/t/truncate.test
@@ -19,10 +19,17 @@ DROP TABLE t;
--echo #
--echo # MDEV-17831 TRUNCATE TABLE removes ROW_FORMAT=COMPRESSED
--echo #
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB KEY_BLOCK_SIZE=4;
TRUNCATE TABLE t1;
--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 #
SHOW TABLE STATUS;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
--echo #
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
index 8f4902fd2de..279cca3177a 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc.test
@@ -1335,9 +1335,16 @@ SELECT * FROM t1 WHERE MATCH (a) AGAINST ('+"good database"' IN BOOLEAN MODE);
DROP TABLE t1;
# MDEV-19974 InnoDB: Cannot load compressed BLOB
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
CREATE TABLE t1(f1 TEXT, FULLTEXT KEY(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES(repeat("this is the test case", 500));
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
-
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
index 46b65590298..4ddb4b435e3 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
@@ -432,6 +432,10 @@ let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
set global innodb_file_per_table=1;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
# Create FTS table
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -579,6 +583,9 @@ SELECT * FROM t1 WHERE MATCH (a,b)
SELECT * FROM t1 ORDER BY id;
DROP TABLE t1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
#------------------------------------------------------------------------------
diff --git a/mysql-test/suite/innodb_gis/t/create_spatial_index.test b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
index 7ddece9ad86..52ade3bdd59 100644
--- a/mysql-test/suite/innodb_gis/t/create_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
@@ -15,6 +15,10 @@
--source include/have_innodb_16k.inc
--source include/have_geometry.inc
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
# Check spatial index functionality on compress table with Primary key
CREATE TABLE tab(c1 int NOT NULL PRIMARY KEY,c2 POINT NOT NULL,
@@ -1107,6 +1111,9 @@ SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
DELETE FROM tab WHERE MBRIntersects(tab.c4, @g1);
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
index f1d72fbe281..d1e7220b0ba 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
@@ -8,11 +8,8 @@ insert into worklog5743 values(repeat("a", 20000));
update worklog5743 set a = (repeat("b", 16000));
SET sql_mode= '';
create index idx on worklog5743(a(900));
-Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
SET sql_mode= default;
begin;
update worklog5743 set a = (repeat("x", 17000));
@@ -101,7 +98,7 @@ create index idx1 on worklog5743_1(a2(4000));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
+Note 1071 Specified key was too long; max key length is 1173 bytes
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_1(a2(436));
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
@@ -121,68 +118,41 @@ show warnings;
Level Code Message
SET sql_mode= '';
create index idx1 on worklog5743_2(a2(4000));
-Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
-show warnings;
-Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
-show create table worklog5743_2;
-Table Create Table
-worklog5743_2 CREATE TABLE `worklog5743_2` (
- `a1` int(11) DEFAULT NULL,
- `a2` text NOT NULL,
- KEY `idx1` (`a2`(768))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
create index idx3 on worklog5743_2(a2(769));
-Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
create index idx4 on worklog5743_2(a2(768));
-Warnings:
-Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
show warnings;
Level Code Message
-Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
create index idx5 on worklog5743_2(a1, a2(765));
-ERROR 42000: Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 768 bytes
create index idx6 on worklog5743_2(a1, a2(764));
show warnings;
Level Code Message
create index idx1 on worklog5743_4(a2(4000));
Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
+Note 1071 Specified key was too long; max key length is 1173 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
+Note 1071 Specified key was too long; max key length is 1173 bytes
show create table worklog5743_4;
Table Create Table
worklog5743_4 CREATE TABLE `worklog5743_4` (
`a1` int(11) DEFAULT NULL,
`a2` text NOT NULL,
- KEY `idx1` (`a2`(768))
+ KEY `idx1` (`a2`(1173))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
create index idx3 on worklog5743_4(a2(769));
-Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
create index idx4 on worklog5743_4(a2(768));
-Warnings:
-Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
show warnings;
Level Code Message
-Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release
create index idx5 on worklog5743_4(a1, a2(765));
-ERROR 42000: Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 768 bytes
create index idx6 on worklog5743_4(a1, a2(764));
show warnings;
Level Code Message
@@ -221,10 +191,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE worklog5743_1 ref idx6 idx6 5 const 1
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE worklog5743_2 ref idx6 idx6 5 const 1
+1 SIMPLE worklog5743_2 ref idx5,idx6 idx5 5 const 1
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE worklog5743_4 ref idx6 idx6 5 const 1
+1 SIMPLE worklog5743_4 ref idx5,idx6 idx5 5 const 1
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
@@ -253,25 +223,23 @@ drop table worklog5743_4;
### Test 5 ###
create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
+ERROR 42000: Specified key was too long; max key length is 1173 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 3072 bytes
-Error 1071 Specified key was too long; max key length is 768 bytes
+Warning 1071 Specified key was too long; max key length is 3072 bytes
+Error 1071 Specified key was too long; max key length is 1173 bytes
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(3072)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
-ERROR 42000: Specified key was too long; max key length is 768 bytes
+ERROR 42000: Specified key was too long; max key length is 1173 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 768 bytes
+Error 1071 Specified key was too long; max key length is 1173 bytes
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(769)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
-ERROR 42000: Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 768 bytes
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(768)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
@@ -282,10 +250,8 @@ update worklog5743 set a1 = 3333;
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(765)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a1, a2);
-ERROR 42000: Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Error 1071 Specified key was too long; max key length is 768 bytes
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(764)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a1, a2);
@@ -315,8 +281,6 @@ connection default;
rollback;
drop table worklog5743;
### Test 6 ###
-create table worklog5743(a TEXT not null, primary key (a(1000)));
-ERROR 42000: Specified key was too long; max key length is 768 bytes
create table worklog5743(a TEXT) ROW_FORMAT=COMPACT;
create index idx on worklog5743(a(768));
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
@@ -350,23 +314,17 @@ drop table worklog5743;
create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC;
SET sql_mode= '';
create index idx1 on worklog5743(a(769));
-Warnings:
-Note 1071 Specified key was too long; max key length is 768 bytes
show warnings;
Level Code Message
-Note 1071 Specified key was too long; max key length is 768 bytes
SET sql_mode= default;
create index idx2 on worklog5743(a(768));
-Warnings:
-Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release
show warnings;
Level Code Message
-Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release
show create table worklog5743;
Table Create Table
worklog5743 CREATE TABLE `worklog5743` (
`a` text NOT NULL,
- KEY `idx1` (`a`(768)),
+ KEY `idx1` (`a`(769)),
KEY `idx2` (`a`(768))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
insert into worklog5743 values(repeat("a", 768));
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
index f064a823b59..ef5b5984f3c 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
@@ -266,7 +266,7 @@ drop table worklog5743_8;
### Test 5 ###
create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
+ERROR 42000: Specified key was too long; max key length is 1536 bytes
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(1537)) ROW_FORMAT=DYNAMIC;
create index idx1 on worklog5743(a2);
diff --git a/mysql-test/suite/innodb_zip/t/cmp_per_index.test b/mysql-test/suite/innodb_zip/t/cmp_per_index.test
index 02c07305b88..d5e682d6e14 100644
--- a/mysql-test/suite/innodb_zip/t/cmp_per_index.test
+++ b/mysql-test/suite/innodb_zip/t/cmp_per_index.test
@@ -24,6 +24,10 @@ SELECT * FROM information_schema.innodb_cmp_per_index_reset;
# see that the table is empty
SELECT * FROM information_schema.innodb_cmp_per_index;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
# create a table that uses compression
CREATE TABLE t (
a INT,
@@ -57,6 +61,9 @@ while ($i)
COMMIT;
ALTER TABLE t DROP INDEX c;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix.test b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
index bc76f52dcbf..2c9da76f9e8 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
@@ -6,6 +6,8 @@ SET default_storage_engine=InnoDB;
--disable_query_log
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
@@ -402,7 +404,9 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
-- error ER_INDEX_COLUMN_TOO_LONG
create index idx on worklog5743(a(768));
create index idx2 on worklog5743(a(767));
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
drop table worklog5743;
-
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
index 1bfff79e94c..04f7ac65edf 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
@@ -6,6 +6,8 @@ SET default_storage_engine=InnoDB;
--disable_query_log
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
@@ -154,14 +156,12 @@ show warnings;
# Test edge cases for indexes using key_block_size=2
SET sql_mode= '';
+--error ER_TOO_BIG_ROWSIZE
create index idx1 on worklog5743_2(a2(4000));
-show warnings;
-show create table worklog5743_2;
create index idx3 on worklog5743_2(a2(769));
show warnings;
create index idx4 on worklog5743_2(a2(768));
show warnings;
--- error ER_TOO_LONG_KEY
create index idx5 on worklog5743_2(a1, a2(765));
show warnings;
create index idx6 on worklog5743_2(a1, a2(764));
@@ -174,7 +174,6 @@ create index idx3 on worklog5743_4(a2(769));
show warnings;
create index idx4 on worklog5743_4(a2(768));
show warnings;
--- error ER_TOO_LONG_KEY
create index idx5 on worklog5743_4(a1, a2(765));
show warnings;
create index idx6 on worklog5743_4(a1, a2(764));
@@ -272,7 +271,6 @@ show warnings;
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(769)) ROW_FORMAT=DYNAMIC;
--- error ER_TOO_LONG_KEY
create index idx1 on worklog5743(a2);
show warnings;
drop table worklog5743;
@@ -285,7 +283,6 @@ update worklog5743 set a1 = 3333;
drop table worklog5743;
create table worklog5743(a1 int, a2 varchar(765)) ROW_FORMAT=DYNAMIC;
--- error ER_TOO_LONG_KEY
create index idx1 on worklog5743(a1, a2);
show warnings;
drop table worklog5743;
@@ -316,10 +313,6 @@ rollback;
drop table worklog5743;
-- echo ### Test 6 ###
-# Create a table with old format, and the limit is 768 bytes.
--- error ER_TOO_LONG_KEY
-create table worklog5743(a TEXT not null, primary key (a(1000)));
-
create table worklog5743(a TEXT) ROW_FORMAT=COMPACT;
# Excercise the column length check in ha_innobase::add_index()
@@ -383,7 +376,9 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
-- error ER_INDEX_COLUMN_TOO_LONG
create index idx on worklog5743(a(768));
create index idx2 on worklog5743(a(767));
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
drop table worklog5743;
-
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
index cb27a9e9776..c9cd9574a95 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
@@ -6,6 +6,8 @@ SET default_storage_engine=InnoDB;
--disable_query_log
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
@@ -396,7 +398,9 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
-- error ER_INDEX_COLUMN_TOO_LONG
create index idx on worklog5743(a(768));
create index idx2 on worklog5743(a(767));
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
drop table worklog5743;
-
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/large_blob.test b/mysql-test/suite/innodb_zip/t/large_blob.test
index b9888ccb53c..dd208129d08 100644
--- a/mysql-test/suite/innodb_zip/t/large_blob.test
+++ b/mysql-test/suite/innodb_zip/t/large_blob.test
@@ -81,6 +81,10 @@ INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo #
--echo # Separate tablespace, Row Format = Compressed, Key Block Size = 2k
--echo #
@@ -103,6 +107,9 @@ CREATE TABLE t1 (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE t1;
--echo #
diff --git a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
index 2bf37f7ee0c..a020496f755 100644
--- a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
@@ -15,6 +15,11 @@
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
+
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
# Prefix index with VARCHAR data type , primary/secondary index and DML ops
CREATE TABLE worklog5743 (
@@ -1325,4 +1330,7 @@ ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE;
ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=COPY;
--disable_info
SHOW CREATE TABLE worklog5743;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
DROP TABLE worklog5743;
diff --git a/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test b/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
index 445fd812183..be9a05b36ce 100644
--- a/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
+++ b/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
@@ -23,6 +23,9 @@ let $innodb_compression_level = `SELECT @@global.innodb_compression_level`;
SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_level=0;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo #******************************************************************
--echo # Test 1-1K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 1K
@@ -65,6 +68,9 @@ SET @inl_val=2;
--echo # set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # set the flags
SET GLOBAL innodb_file_per_table=on;
@@ -151,6 +157,9 @@ DROP TABLE tab5;
--echo # reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=0;
SET GLOBAL innodb_cmp_per_index_enabled=1;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # create a table with page size=4K
--echo # create indexes on each column.(total 9 indexes)
@@ -359,6 +368,9 @@ DROP TABLE tab5;
--echo # reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # create a table with page size=2K
--echo # create indexes on each column.(total 9 indexes)
@@ -424,6 +436,9 @@ DROP TABLE tab5;
--echo # reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # create a table with page size=4K
--echo # create indexes on each column.(total 9 indexes)
@@ -855,6 +870,9 @@ DROP TABLE tab5;
--echo # reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # create a table with page size=2K
--echo # create indexes on each column.(total 9 indexes)
@@ -1115,6 +1133,10 @@ DROP TABLE tab5;
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_failure_threshold_pct=10;
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--echo # create a table with page size=2K
--echo # create indexes on each column.(total 9 indexes)
@@ -1333,5 +1355,6 @@ eval SET GLOBAL innodb_file_per_table=default;
eval SET GLOBAL innodb_cmp_per_index_enabled=default;
--disable_query_log
eval SET GLOBAL innodb_compression_level=$innodb_compression_level;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
--enable_query_log
eval SET GLOBAL innodb_compression_failure_threshold_pct=default;
diff --git a/mysql-test/suite/parts/t/partition_alter_innodb.test b/mysql-test/suite/parts/t/partition_alter_innodb.test
index 451bec05adc..4ea3a0da88c 100644
--- a/mysql-test/suite/parts/t/partition_alter_innodb.test
+++ b/mysql-test/suite/parts/t/partition_alter_innodb.test
@@ -1,4 +1,11 @@
--source include/have_innodb.inc
--source include/have_partition.inc
--let $engine=InnoDB
+--disable_query_log
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+--enable_query_log
--source inc/part_alter_values.inc
+--disable_query_log
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
+--enable_query_log
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result
index 1b8e7bf3a56..051bb0e321c 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_evict_basic.result
@@ -1,9 +1,15 @@
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
SELECT @@global.innodb_buffer_pool_evict;
@@global.innodb_buffer_pool_evict
+SET GLOBAL innodb_read_only_compressed=ON;
+CREATE TABLE t(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+SET GLOBAL innodb_read_only_compressed=OFF;
CREATE TABLE t(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
SELECT @@global.innodb_buffer_pool_evict;
@@global.innodb_buffer_pool_evict
DROP TABLE t;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
diff --git a/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result b/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result
index 31bc11de717..1a32ac6e99e 100644
--- a/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_cmp_per_index_enabled_basic.result
@@ -1,3 +1,5 @@
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
SELECT @@global.innodb_cmp_per_index_enabled;
@@global.innodb_cmp_per_index_enabled
0
@@ -61,3 +63,4 @@ uncompress_ops 0
uncompress_time 0
DROP TABLE t;
SET GLOBAL innodb_cmp_per_index_enabled=default;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 2fe4fe028af..814decedd41 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1449,6 +1449,18 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_READ_ONLY_COMPRESSED
+SESSION_VALUE NULL
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Make ROW_FORMAT=COMPRESSED tables read-only (ON by default)
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ROLLBACK_ON_TIMEOUT
SESSION_VALUE NULL
DEFAULT_VALUE OFF
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
index 7d64e210865..1c3718616c0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_evict_basic.test
@@ -2,11 +2,18 @@
# This is a debug variable for now
-- source include/have_debug.inc
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
SELECT @@global.innodb_buffer_pool_evict;
+SET GLOBAL innodb_read_only_compressed=ON;
+--error ER_UNSUPPORTED_COMPRESSED_TABLE
+CREATE TABLE t(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+SET GLOBAL innodb_read_only_compressed=OFF;
+
CREATE TABLE t(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
SET GLOBAL innodb_buffer_pool_evict = 'uncompressed';
# Should always be empty.
SELECT @@global.innodb_buffer_pool_evict;
DROP TABLE t;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
diff --git a/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test b/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test
index 432c04857ec..dbb10e0bb88 100644
--- a/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_cmp_per_index_enabled_basic.test
@@ -2,6 +2,9 @@
# CREATE TABLE ... KEY_BLOCK_SIZE=8; does not work with page size = 4k
-- source include/have_innodb_16k.inc
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
+
# Check the default value
SELECT @@global.innodb_cmp_per_index_enabled;
@@ -64,3 +67,4 @@ DROP TABLE t;
#
SET GLOBAL innodb_cmp_per_index_enabled=default;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;