Bug #78895 Lack information about generated columns in mysql_fetch_fields function

Submitted: 21 Oct 2015 9:46 Modified: 21 Oct 2015 10:08
Reporter: Milosz Bodzek Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.7.8,5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[21 Oct 2015 9:46] Milosz Bodzek
Description:
There is no way to figure out that column is *Generated Column* using function mysql_fetch_fields.

How to repeat:
Create test table with generated column f.e.:

CREATE TABLE `collection1` (
  `doc` json DEFAULT NULL,
  `_id` varchar(32) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id'))) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Then try to get details about each column by call mysql_fetch_fields function, returned value don't contain information if column is generated.

Suggested fix:
Add one more flag to flags field - GENERATED_FLAG.
[21 Oct 2015 10:08] MySQL Verification Team
Hello Milosz,

Thank you for the report.

Thanks,
Umesh

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.