fix bug in mySQL WHERE clause for mrefs