DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

More meta information from MYSQL_FIELD helpful [rt.cpan.org #123133]

Open mbeijen opened this issue 8 years ago • 0 comments
trafficstars

Migrated from rt.cpan.org#123133 (status was 'new')

Requestors:

From [email protected] on 2017-09-26 18:32:31:

For a current project, it would be nice to have more information from MYSQL_FIELD->flags and available in Perl to gain more information about column types.

What I'm currently missing is:

-  ENUM_FLAG and SET_FLAG from MYSQLD_FIELD->flags to be able to detect ENUMs and SETs (which otherwise present themselves as "char")
- UNSIGNED_FLAG for unsigned detection

I could even live some kind of extension for dbd_st_FETCH_internal which simple returns MYSQLD_FIELD->flags as is, and then check the bits myself.

- MYSQL_FIELD->org_name and MYSQL_FIELD->org_table would be helpful to access original table and column names (bypassing AS aliases)

I unfortunately, due to circumstances, cannot use accesses INFORMATION_SCHEMA or SHOW COLUMNS here to query the actual column types as the queries I have to analyze are basically free form and often heavily aliased, so I cannot sensible find out the affected columns of the tables without parsing the query myself, as org_name and org_table are also not available from Perl.

mbeijen avatar Nov 14 '17 19:11 mbeijen