I've an odd problem:
SELECT a.uid, b.*, c.liveId FROM a
INNER JOIN b ON (a.uid=b.uid AND a.versionNo=b.versionNo)
LEFT JOIN c ON (a.uid=c.uid)
WHERE a.memberId=1;
I call that from a query browser and it returns 3 rows. I call it from within a stored procedure and it gives 2 rows (the LEFT JOIN becomes ineffective).
DELIMITER //
DROP PROCEDURE IF EXISTS sp_Test //
CREATE
DEFINER = CURRENT_USER
PROCEDURE sp_Test( IN in_mid INTEGER UNSIGNED )
READS SQL DATA
NOT DETERMINISTIC
BEGIN
SELECT a.uid, b.*, c.liveId FROM a
INNER JOIN b ON (a.uid=b.uid AND a.versionNo=b.versionNo)
LEFT JOIN c ON (a.uid=c.uid)
WHERE a.memberId=in_mid;
END //
DELIMITER ;
I'm stumped! Any suggestions?