I've noticed, that since 5.1.3 version we've got 1 more error during installation:
SELECT wbf_Affiliates.* ,(u.PortalUserId) AS `UserId`,(IF( LENGTH(u.Login), u.Login, '')) AS `UserName`,(ap.Name) AS `PlanName`,(wbf_Affiliates.LastPaymentDate) AS `LastPaymentDate_date`,(wbf_Affiliates.LastPaymentDate) AS `LastPaymentDate_time`,(wbf_Affiliates.LastOrderDate) AS `LastOrderDate_date`,(wbf_Affiliates.LastOrderDate) AS `LastOrderDate_time`,(wbf_Affiliates.CreatedOn) AS `CreatedOn_date`,(wbf_Affiliates.CreatedOn) AS `CreatedOn_time`
FROM wbf_Affiliates
LEFT JOIN wbf_PortalUser u ON wbf_Affiliates.PortalUserId = u.PortalUserId
LEFT JOIN wbf_AffiliatePlans ap ON wbf_Affiliates.AffiliatePlanId = ap.AffiliatePlanId
WHERE (`wbf_Affiliates`.PortalUserId = '-1')
LIMIT 0,1
This is because installation wizard now uses the same method for logging user in as Front-End code. That's why I propose to skip affiliate checks during installation.