Bug #103543 Can't access table when set wrong compression algorithm
Submitted: 30 Apr 2021 11:27 Modified: 30 Apr 2021 12:55
Reporter: Qingda Hu Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[30 Apr 2021 11:27] Qingda Hu
Description:
When we create a table with wrong compression algorithm without strict mode, the wrong compression algorithm string is logged into the dd info (compress) of the table. If we restart the server or reload the dd cache of the table, the table can not be accessed normally.

How to repeat:
Create an database instance and perform the following instructions: 

CREATE DATABASE test;
USE test;
set session innodb_strict_mode='OFF';
CREATE TABLE t0(c0 INT KEY)COMPRESSION="lz4_1.0" ENGINE=InnoDB;

Then, restart the database or empty the dd info of the table 't0', and perform the following instructions:

USE test;
mysql> select * from t0;
ERROR 1525 (HY000): Incorrect COMPRESSION value: 'lz4_1.0'
[30 Apr 2021 11:30] Qingda Hu
Sorry, lei me describe clearly, the table can be created before restarted. 

CREATE DATABASE test;
USE test;
set session innodb_strict_mode='OFF';
CREATE TABLE t0(c0 INT KEY)COMPRESSION="lz4_1.0" ENGINE=InnoDB;
insert into t0 value (1), (2), (3), (4), (5);

mysql> select * from t0;
+----+
| c0 |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
+----+

Then, restart the database or empty the dd info of the table 't0', and perform the following instructions:

mysql> USE test;
mysql> select * from t0;
ERROR 1525 (HY000): Incorrect COMPRESSION value: 'lz4_1.0'
[30 Apr 2021 12:55] MySQL Verification Team
Hello Qingda Hu,

Thank you for the report and test case.
I'm not seeing this issue in 8.0.24 build(most likely handled as part of Bug #98593/Bug #100667). Could you please try in 8.0.24 build and let us know if you are still seeing the issue? Thank you.

- release/debug
 bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.24-debug MySQL Community Server - GPL - Debug

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE test;
Query OK, 1 row affected (0.01 sec)

mysql> USE test;
Database changed
mysql> set session innodb_strict_mode='OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t0(c0 INT KEY)COMPRESSION="lz4_1.0" ENGINE=InnoDB;
Query OK, 0 rows affected, 1 warning (0.11 sec)

mysql> insert into t0 value (1), (2), (3), (4), (5);
Query OK, 5 rows affected (0.01 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> select * from t0;
+----+
| c0 |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
+----+
5 rows in set (0.00 sec)

mysql> restart;
Query OK, 0 rows affected (0.00 sec)

mysql> Restarting mysqld...
2021-04-30T12:51:50.418709Z mysqld_safe Number of processes running now: 0
2021-04-30T12:51:50.425964Z mysqld_safe mysqld restarted

mysql>
mysql> USE test;
No connection. Trying to reconnect...
Connection id:    7
Current database: *** NONE ***

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed, 1 warning
mysql> select * from t0;
+----+
| c0 |
+----+
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
+----+
5 rows in set (0.01 sec)

regards,
Umesh