You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While binding value in mysql_bind_sql_var(), we map PG type id to the
corresponding MySQL type in mysql_from_pgtyp() and then appropriately
create a buffer containing the value. However, this logic only cares
about the built-in types and as enum has a user-defined type, it
resulted in an error. To support bind for enum values, if the type
is an enum then use ANYENUMOID builtin type and convert the value to
string form using its output function. MySQL accepts enum value in
string form so we map ANYENUMOID to MYSQL_TYPE_STRING too.
Note that we set sql_mode to ANSI_QUOTES while creating a connection
with MySQL that causes to insert an empty string at MySQL side for the
enum column when the given enum value is not present. And thus, to
select from such a table having enum value as '', we need to create an
enum type at Postgres side with all valid values and ''. Also, if we
try to insert an enum value which is not present in PG's enum type,
then PG's sanity check itself throws an error.
FDW-169, Suraj Kharage, reviewed by Jeevan Ladhe.
0 commit comments