Bug #118347 8.4.5 functions in constraints, partitions, or virtual columns may have failed
Submitted: 3 Jun 17:23 Modified: 11 Jul 4:41
Reporter: Jervin Real Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.4.5 OS:Any
Assigned to: CPU Architecture:Any

[3 Jun 17:23] Jervin Real
Description:
When upgrading to 8.4.5, we are receiving messages like these.

[ERROR] [MY-013135] [Server] Incorrect information in file: './mydbname/mytablename.frm'
[Warning] [MY-014078] [Server] Can not open table `mydbname`.`mytablename`; functions in constraints, partitions, or virtual columns may have failed.

The FRM reference may be bogus as open_table_error may be hitting the default error case (we have yet to debug). The instance can be successfully upgraded with --check-table-functions=WARN

If we dump these tables, load them on a sandbox on 8.4.4 and upgrade the sandbox to 8.4.5, these errors do not reproduce.

How to repeat:
No repro case yet.
[3 Jun 17:52] Jervin Real
There is no generated/virtual columns on any of tables reported with these errors fyi.
[4 Jun 9:28] MySQL Verification Team
Hello Jervin Real,

Thank you for the report and feedback.
Could you please share the version which you are upgrading to 8.4.5 and also schema dump to reproduce this issue at our end?  As you mentioned "generated/virtual columns on any of tables reported with these errors" - interesting to see what is causing this issue during upgrade. Thank you.

Looking at the 8.4.5 change log, Quoting here -

Important Change: When an SQL function is improved from one release to the next, it may throw SQL errors in situations in which it previously did not. If this happens in a table's constraints, default expressions, partitioning expressions, or virtual columns, the table could not be opened. This prevented both analyzing the problem (using, for example, SHOW CREATE TABLE) and addressing it (such as with an ALTER TABLE ... DROP ... statement).

Now, on server upgrade, we scan the data dictionary for tables that use any of the features just mentioned. We then try to open such tables, and if we fail to do so, we alert the user. This patch addresses this. The --check-table-functions server option introduced in this release helps to address this problem by making it possible to specify the server's behavior when encountering an error with such a function. Set this option to WARN in order to log a warning for each table which the server could not open; setting it to ABORT also logs these warnings as WARN, but aborts the server upgrade if any issues were found.

ABORT is the default; this enables the user to fix the issue using the older version of the server before upgrading to the new one. WARN flags the issues, but allows the user to continue in interactive mode while addressing the problem. (Bug #36890891)

References: See also: Bug #37009318. This issue is a regression of: Bug #98950, Bug #98951, Bug #31031886, Bug #31031888.

Please see https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-5.html

regards,
Umesh
[4 Jun 16:47] Jervin Real
Hi Umesh,

Thanks for looking, this is an upgrade from 8.4.4 to 8.4.5. I will need to sanitize the schema before sharing, however, when that schema is loaded on 8.4.4 and upgraded to 8.4.5, we do not get the error. It might be a non-visible component of the table that is causing the failure.
[11 Jun 4:41] MySQL Verification Team
Hello Jervin Real,

Thank you, I'll wait for the schema which causing the issue. 

SIncerely,
Umesh
[12 Jul 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".