[MDEV-26262] frm is reported corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD Created: 2021-07-28  Updated: 2021-10-21  Resolved: 2021-10-20

Status: Closed
Project: MariaDB Server
Component/s: Virtual Columns
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.2.41, 10.3.32, 10.4.22, 10.5.13, 10.6.5, 10.7.1

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Nikita Malyavin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-18278 Misleading error message in error log... Closed

 Description   

CREATE TABLE t1 (a INT,b INT AS (b is NULL) VIRTUAL);

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

10.7.0-dbg>CREATE TABLE t1 (a INT,b INT AS (b is NULL) VIRTUAL);
ERROR 4029 (01000): Expression for field `b` is referring to uninitialized field `b`

Yet;

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

2021-07-28 20:18:44 4 [ERROR] mysqld: Incorrect information in file: './test/t1.frm'

May only be a cosmetic issue (i.e. the error in the error log should not be shown as the table is never created successfully).

If no underlying bug, propose to not show (i.e. prevent) any error in error log (so as to not confuse DBA's).



 Comments   
Comment by Nikita Malyavin [ 2021-10-07 ]

the patch for review is: https://github.com/MariaDB/server/commit/a15934fb331228e83b704018661227c2b4ca7342

Comment by Oleksandr Byelkin [ 2021-10-13 ]

Add more description about the problem (why it happens) and OK to push

Comment by Nikita Malyavin [ 2021-10-13 ]

The issue is cosmetic only. However, [ERROR] is reported to the server output, which shouldn't happen in this case, since it's just the table was created with wrong spec.

This happens because the check is made only on the (already created) frm parsing stage, where any parse_vcol_defs error is considered as a corrupted frm.

Here we should not consider frm corrupted. I think we should never report 'frm corrupted' during table creation, and it is always bogus.

Comment by Nikita Malyavin [ 2021-10-20 ]

Though it is accidentally duplicated with midenok's work, I made some additional changes:

  • add debug assertion – it shouldn't report corrupted during create table
  • add test without false-positive result
Generated at Thu Feb 08 09:43:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.