So based on our two threads, i’ve had to make some assumptions, so please clarify.
I have 2 tables, based on your posts.
CREATE TABLE IF NOT EXISTS table1 ( id BINARY(16) DEFAULT (UUID_TO_BIN(UUID())) NOT NULL PRIMARY KEY, name VARCHAR(256), status VARCHAR(20) )
CREATE TABLE IF NOT EXISTS table2 ( id BINARY(16) DEFAULT (UUID_TO_BIN(UUID())) NOT NULL PRIMARY KEY, title VARCHAR(256), table1_id BINARY(16) )
I insert two entries in Table 1: insert into table1(name, status) values ('a','pending'), ('b', 'pending');
Now the issue I can see looks like it comes from getting the id property in a binary format from our API (using SELECT id from table1 WHERE name='?';). and sending it back as binary.
What I recommend here is to coerce the primary key between UUID formats, to ensure it remains consistent, so your select statement becomes SELECT BIN_TO_UUID(id) from table1 WHERE name='?'; then on insert, it becomes insert into table2 (title, table1_id) VALUES (?, UUID_TO_BIN(?))
This is the simplest way to handle the conversion, otherwise you can look at using SELECT statements from your insert, if the name column is meant to be unique from table1