How can I programmatically list all available datatypes in MySQL?
Like SELECT * FROM sys.types in MS-SQL.
I believe it is not possible, but anybody knows for sure ?
Note: I do not need only the types used as in
SELECT DISTINCT data_type FROM information_schema.columns
It is not possible to programmatically list data types available in MySQL, unfortunately. MySQL doesn't have user-defined types, so it's less of a problem to hard-code a type list, as it doesn't change much (yet). Presumably when UDTs would be implemented, someone would also add an information_schema.types
table. If you want to see all types currently implemented, you can check the source code sql/sql_yacc.yy
e.g. for MySQL 5.6.15 here:
https://github.com/darnaut/mysql-server/blob/mysql-5.6.15/sql/sql_yacc.yy#L6399
(This assumes you can read yacc and C++ syntax.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With