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:
@@ -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
|
||||
|
Reference in New Issue
Block a user