MySQL test for GETs involving relationships