[MDEV-11073] Confusing error message when enabling page compression and innodb file format is incorrect Created: 2016-10-17  Updated: 2016-10-27  Resolved: 2016-10-27

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Storage Engine - InnoDB
Affects Version/s: 10.1.18
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Geoff Montee (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Not a Bug Votes: 0
Labels: innodb, page_compression


 Description   

InnoDB page compression in MariaDB 10.1 requires innodb_file_format to be set to Barracuda. If innodb_file_format is not Barracuda, and if the user tries to enable InnoDB page compression for a particular table, MariaDB returns a somewhat confusing error. e.g.:

MariaDB [db1]> SHOW GLOBAL VARIABLES LIKE 'innodb_compression_algorithm';                                                                                    +------------------------------+-------+
| Variable_name                | Value |
+------------------------------+-------+
| innodb_compression_algorithm | zlib  |
+------------------------------+-------+
1 row in set (0.00 sec)
 
MariaDB [db1]> SHOW GLOBAL VARIABLES LIKE 'innodb_file_format';                                                                                              +--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| innodb_file_format | Antelope |
+--------------------+----------+
1 row in set (0.00 sec)
 
MariaDB [db1]> CREATE TABLE `tab_compressed` (
    ->   `id` int(11) NOT NULL,
    ->   `str` varchar(50) DEFAULT NULL,
    ->   PRIMARY KEY (`id`)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PAGE_COMPRESSED=1;
ERROR 1005 (HY000): Can't create table `db1`.`tab_compressed` (errno: 140 "Wrong create options")

"Wrong create options" is kind of confusing if the user doesn't know to check innodb_file_format. Wouldn't it be better if the error message said something like "PAGE_COMPRESSED can only be set if innodb_file_format is Barracuda"?



 Comments   
Comment by Jan Lindström (Inactive) [ 2016-10-27 ]

When you get confusing error messages you could use show warnings; This normally will include more detailed information from storage engine. As this PAGE_COMPRESSED is only supported by InnoDB storage engine it is not good idea to introduce a new error message that would be very storage engine specific.

Comment by Geoff Montee (Inactive) [ 2016-10-27 ]

Ah, I do see that SHOW WARNINGS has some more useful messages:

MariaDB [db1]> SHOW WARNINGS;
+---------+------+-------------------------------------------------------------------------------+
| Level   | Code | Message                                                                       |
+---------+------+-------------------------------------------------------------------------------+
| Warning |  140 | InnoDB: PAGE_COMPRESSED requires innodb_file_format > Antelope.               |
| Error   | 1005 | Can't create table `db1`.`tab_compressed` (errno: 140 "Wrong create options") |
| Warning | 1030 | Got error 140 "Wrong create options" from storage engine InnoDB               |
+---------+------+-------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

Thanks!

Generated at Thu Feb 08 07:47:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.