Basically I am just looking for an equivalent of this sql statement:
SELECT * FROM products GROUP BY merchant_id ORDER BY id DESC LIMIT 10;
In a subquery grab the max(id) per merchant and in the outer query join this back to the products table to get the other fields:
select p.* from products p inner join (select merchant_id, max(id) as max_id from products group by merchant_id order by max(id) desc limit 10) t1 on p.id=t1.max_id
You should not really rely on how MySQL implements the relaxed group by clause because that may change without any notice. Remember: nothing guarantees even if ONLY_FULL_GROUP_BY sql mode is turned off, that the query in the question would produce the expected output!