Bug #99821 InnoDB: Encryption algorithm support missing: N after running alter table
Submitted: 9 Jun 2020 9:48 Modified: 22 Jun 2020 12:29
Reporter: Cheng Zhou Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.22 OS:Red Hat
Assigned to: CPU Architecture:Any

[9 Jun 2020 9:48] Cheng Zhou
Description:
In a production environment,MySQL version was 5.7.22.When running "alter table t1 engine=innodb" (some other SQL statements might also be running), error occurred. 

In error log:
[ERROR] InnoDB: Encryption algorithm support missing: N
[ERROR] InnoDB: Unable to read temporary file for table account/TX_INFO#P#p18

client:
ERROR 1034 (HY000) at line 1: Incorrect key file for table 'TX_INFO'; try to repair it

I viewed the code,
in MySQL5.7.22:
in function 'Encryption::decrypt(...)':
	/* Do nothing if it's not an encrypted table. */
	if (!is_encrypted_page(src)) {
		return(DB_SUCCESS);
	}

while in MySQL8.0:
Fixed bug#27286020 [ERROR] [MY-NNN] INNODB: ENCRYPTION ALGORITHM SUPPORT MISSING: N
We need to ignore decrypt example pages when getting space id in startup.
Since the space id is in the page header which is not encrypted.

Approved by Jimmy Yang <jimmy.yang@oracle.com> over IM.
Allen Lai committed on 22 Dec 2017 
1 parent 36e7ec4 commit 4565b39c3478b85dac00954b0b047845d4a4c23e

                @@ -10123,7 +10123,7 @@ Encryption::decrypt(
10123 10123	byte		remain_buf[MY_AES_BLOCK_SIZE * 2];
10124 10124	Block*		block;
10125 10125
10126       -	if (!is_encrypted_page(src)) {
      10126 +	if (!is_encrypted_page(src) || m_type == Encryption::NONE) {
10127 10127		/* There is nothing we can do. */
10128 10128		return(DB_SUCCESS);
10129 10129	}

It seems that they have the same reason, but not fix in MySQL5.7.22

How to repeat:
I am not sure
[10 Jun 2020 12:27] MySQL Verification Team
Hi Mr. Zhou,

Thank you for your bug report.

However, we need a fully repeatable test case in order to verify any bug report.

Without test case, we can not repeat your problem, which would force us to close the report.

Thanks in advance.
[10 Jun 2020 12:29] MySQL Verification Team
One more detail.

You are using the old release of 5.7 version. There are so many bugs that were fixed between this old release and the latest 5.7 release.

Hence, try to reproduce your problem with latest 5.7.
[22 Jun 2020 2:44] Jie Zhou
I figure out a way to repeat the bug. Refer to:
https://bugs.mysql.com/bug.php?id=99938
[22 Jun 2020 12:29] MySQL Verification Team
Hi,

This bug is now a duplicate of the bug:

https://bugs.mysql.com/bug.php?id=99938