Bug with multiple joins in mysql2