Bug #98403 Inaccurate documentation for extra columns in INFORMATION_SCHEMA.COLUMNS
Submitted: 25 Jan 2020 19:37 Modified: 28 Jan 2020 15:28
Reporter: Fredric Johansson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[25 Jan 2020 19:37] Fredric Johansson
Description:
The documentation for the extra column in information_schema.columns is not documented correctly.
For generated columns it documents it having a value of "VIRTUAL GENERATED or VIRTUAL STORED for generated columns."
but the actual value is "STORED GENERATED" or "VIRTUAL GENERATED"

How to repeat:
CREATE TABLE `test_table` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `core_unit_id` int DEFAULT NULL,
  `core_unit_id_not_null_stored` int GENERATED ALWAYS AS (coalesce(`core_unit_id`,0)) STORED NOT NULL,
  `core_unit_id_not_null_virtual` int GENERATED ALWAYS AS (coalesce(`core_unit_id`,0)) VIRTUAL NOT NULL,
  PRIMARY KEY (`id`)
);

mysql> SELECT column_name, extra FROM information_schema.columns WHERE table_name='test_table';
+-------------------------------+-------------------+
| COLUMN_NAME                   | EXTRA             |
+-------------------------------+-------------------+
| id                            | auto_increment    |
| core_unit_id                  |                   |
| core_unit_id_not_null_stored  | STORED GENERATED  |
| core_unit_id_not_null_virtual | VIRTUAL GENERATED |
+-------------------------------+-------------------+
4 rows in set (0.00 sec)
[25 Jan 2020 21:16] MySQL Verification Team
Thank you for the bug report.