mysql
mysql copied to clipboard
Identify ENUM and SET types correctly
ENUM and SET values show up with fieldType = String
. This is actually an old upstream bug: https://bugs.mysql.com/bug.php?id=31134
But the documentation has in fact been updated to reflect the status quo: https://dev.mysql.com/doc/refman/5.7/en/c-api-data-structures.html
ENUM and SET values are returned as strings. For these, check that the type value is MYSQL_TYPE_STRING and that the ENUM_FLAG or SET_FLAG flag is set in the flags value.
It seems to me that this library could work around that inconsistency — or, at the very least, populate those flags into fieldFlags
, to even make it possible to differentiate strings from enums and sets.