Get the id of multiple inserted/updated rows I insert my _as_ci accent sensitive, case-insensitive rows. Tail is unique, id is auto_increment.

INSERT INTO tails (tail) VALUES ('Hello'), ('cafe'), ('Café') ON DUPLICATE KEY UPDATE tail = VALUES(tail);

I could try to get the ids out like this:

SELECT id, tail FROM tails WHERE tail IN ('Hello', 'cafe', 'Café')

But I've had experience with it matching rows in MySQL but I can't do the exact matching process in PHP. If only PHP could collation compare.

Is there any way to get MySQL to also return the original string from the IN so I can do an exact comparison in PHP or is there a better method I'm missing?

This code is run extremely often, so I can't afford to run each insert individually.
I could try to get the ids out like this:
  
  SELECT id, tail FROM tails WHERE tail IN ('Hello', 'cafe', 'Café')


Do

SELECT tails.id, tails.tail, criteria.pos
FROM tails 
JOIN ( SELECT 1 pos, 'Hello' tail UNION ALL
       SELECT 2,     'cafe'       UNION ALL
       SELECT 3,     'Café' ) criteria ON tails.tail = criteria.tail


and no problems with identifying (you know what pos to what tail was assigned).