Closed alfredosilvestre-natixis closed 1 year ago
There is an issue when importing hex into MySQL comming from a Postgres dump.
Example in Postgres dump:
INSERT INTO public.ipaddress VALUES ('4f6ae4b5-8eb1-4966-8457-e19d9c19850d', '\x7ee572fa');
Result in MySQL:
+----------------------------------+----------------------+ | id | host | +----------------------------------+----------------------+ | 00015636142b499ea8a782606466f4b7 | 0x783765653537326661 | +----------------------------------+----------------------+
What works inserting in MySQL:
INSERT INTO public.ipaddress VALUES ('4f6ae4b5-8eb1-4966-8457-e19d9c19850d', X'7ee572fa');
+----------------------------------+------------+ | id | host | +----------------------------------+------------+ | 00015636142b499ea8a782606466f4b7 | 0x7EE572FA | +----------------------------------+------------+
Right now we are using perl to replace:
perl -p -i -e 's/'\''\\x(\S+)'\''/X'\''$1'\''/g' "${MYSQL_DUMP}.sql"
There is an issue when importing hex into MySQL comming from a Postgres dump.
Example in Postgres dump:
Result in MySQL:
What works inserting in MySQL:
Result in MySQL:
Right now we are using perl to replace: