1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
Marko Mäkelä
2020-11-10 17:21:16 +02:00
parent c498250888
commit 9bc874a594
65 changed files with 396 additions and 192 deletions

View File

@@ -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