[MDEV-23307] Document how page_compression_level and page_compression table options interact for InnoDB Created: 2020-07-28  Updated: 2023-12-15

Status: Open
Project: MariaDB Server
Component/s: Documentation, Storage Engine - InnoDB
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: suresh ramagiri Assignee: Joe Cotellese
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
PartOf

 Description   

If the table is having page_compressed=on and page_compression_level=1 - any value from 1-9, are unable to disable the page compression. With just page_compressed=on, we can disable though.

Here are the worklogs for your reference.
Observed same behavior with MariaDB 10.4.13.

MariaDB [test]> select @@version;
+-----------------+
| @@version |
+-----------------+
| 10.3.23-MariaDB |
+-----------------+
1 row in set (0.001 sec)
 
MariaDB [test]> create table tab1 (a int) page_compressed='on';
Query OK, 0 rows affected (0.025 sec)
 
MariaDB [test]> create table tab2 (a int) page_compressed='on', page_compression_level=1;
Query OK, 0 rows affected (0.016 sec)
 
MariaDB [test]> show create table tab1;
+-------+----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------+
| tab1 | CREATE TABLE `tab1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`='on' |
+-------+----------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)
 
MariaDB [test]> show create table tab2;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| tab2 | CREATE TABLE `tab2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`='on' `page_compression_level`=1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
 
MariaDB [test]> insert into tab1 values (1),(1),(1);
Query OK, 3 rows affected (0.002 sec)
Records: 3 Duplicates: 0 Warnings: 0
 
MariaDB [test]> insert into tab2 values (1),(1),(1);
Query OK, 3 rows affected (0.003 sec)
Records: 3 Duplicates: 0 Warnings: 0
 
MariaDB [test]> alter table tab1 page_compressed='off';
Query OK, 0 rows affected (0.022 sec)
Records: 0 Duplicates: 0 Warnings: 0
 
MariaDB [test]> alter table tab2 page_compressed='off';
ERROR 1478 (HY000): Table storage engine 'InnoDB' does not support the create option 'PAGE_COMPRESSION_LEVEL'
 
MariaDB [test]> show create table tab1;
+-------+-----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------+
| tab1 | CREATE TABLE `tab1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`='off' |
+-------+-----------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
 
MariaDB [test]> show create table tab2;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| tab2 | CREATE TABLE `tab2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`='on' `page_compression_level`=1 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)



 Comments   
Comment by Marko Mäkelä [ 2020-07-28 ]

I think that this is a documentation issue. I tried some code changes to create_table_info_t::check_table_options(), but it would only break things. Here is my test case that passes on 10.2 without any code changes:

--source include/have_innodb.inc
 
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=INNODB
page_compressed=1 page_compression_level=1;
 
--error ER_ILLEGAL_HA_CREATE_OPTION
ALTER TABLE t1 page_compressed=OFF;
ALTER TABLE t1 page_compression_level=default;
ALTER TABLE t1 page_compressed=OFF;
 
SHOW CREATE TABLE t1;
ALTER TABLE t1 page_compressed=default;
SHOW CREATE TABLE t1;
 
DROP TABLE t1;

Note: the canonical way to delete attributes from the SHOW CREATE TABLE output seems to be to set them to DEFAULT. The penultimate SHOW CREATE TABLE would still display page_compressed=OFF, which inside the storage engine is equivalent to the default setting.

Generated at Thu Feb 08 09:21:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.