hellofresh/klepto

MySQL - Binary and Bit field support

Closed this issue · 2 comments

In some cases binary/bit fields are not handled correctly.

Use the following sql to create a db and do klepto steal

CREATE TABLE users
(
  id binary(16) PRIMARY KEY NOT NULL,
  username varchar(50) NOT NULL,
  email varchar(255) NOT NULL,
  active tinyint(1) NOT NULL,
  gender char(1)
);

CREATE TABLE orders
(
  id binary(16) PRIMARY KEY NOT NULL,
  user_id binary(16) NOT NULL,
  CONSTRAINT orders_ibfk_1 FOREIGN KEY (user_id) REFERENCES users (id)
);

INSERT INTO users (id, username, email, active, gender) VALUES (0x0D60A85E0B904482A14C108AEA2557AA, 'wbo', 'wbo@hellofresh.com', 1, 'm');
INSERT INTO users (id, username, email, active, gender) VALUES (0x39240E9FAE094E959FD0A712035C8AD7, 'kp', 'kp@hellofresh.com', 1, null);
INSERT INTO users (id, username, email, active, gender) VALUES (0x66A45C1B19AF4AB587471B0E2D79339D, 'il', 'il@hellofresh.com', 1, 'm');
INSERT INTO users (id, username, email, active, gender) VALUES (0x9E4DE779D6A044BCA53120CDB97178D2, 'lp', 'lp@hellofresh.com', 0, 'f');

INSERT INTO orders (id, user_id) VALUES (0xE650AD64F1E44F91ABEAEC1A70992926, 0x39240E9FAE094E959FD0A712035C8AD7);
INSERT INTO orders (id, user_id) VALUES (0xF1F7C9C7BDB74626A5C944D8942E52DD, 0x39240E9FAE094E959FD0A712035C8AD7);
INSERT INTO orders (id, user_id) VALUES (0x7EE31A7F5140483B8BA1FA8F116219C0, 0x66A45C1B19AF4AB587471B0E2D79339D);
INSERT INTO orders (id, user_id) VALUES (0xB9BCD5E175E6412DBE87278003519717, 0x66A45C1B19AF4AB587471B0E2D79339D);
INSERT INTO orders (id, user_id) VALUES (0xDDA290FF624346D983CBACBAD41E936E, 0x66A45C1B19AF4AB587471B0E2D79339D);
INSERT INTO orders (id, user_id) VALUES (0x453F4498B4E0485F94FA72F233BB7958, 0x9E4DE779D6A044BCA53120CDB97178D2);
INSERT INTO orders (id, user_id) VALUES (0x8BDF39D8616C45D4826FBAD30CB4E1A3, 0x9E4DE779D6A044BCA53120CDB97178D2);
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically closed because it has not had any activity in the last 21 days. Feel free to re-open in case you would like to follow up.