fix find_ids_in_ranges that find multiple ranges with joins
fix find_ids_in_ranges that find multiple ranges with joins

Change-Id: I9c4dd94cac51e84425ed06472a3222ff5c5a1a83
Reviewed-on: https://gerrit.instructure.com/13545
Tested-by: Jenkins <d95b56ce41a2e1ac4cecdd398defd7414407cc08@instructure.com>
Reviewed-by: Jeremy Stanley <b3f594e10a9edcf5413cf1190121d45078c62290@instructure.com>

skmezanul/canvas-lms,utkarshx/canvas-lms,Jyaasa/canvas-lms,matematikk-mooc/canvas-lms,redconfetti/canvas-lms,dgynn/canvas-lms,usmschuck/canvas,HotChalk/canvas-lms,instructure/canvas-lms,wye0220/shindig-canvas,djbender/canvas-lms,Unow/ins,AndranikMarkosyan/lms,greyhwndz/canvas-lms,Unow/canvas-lms,wimemx/Canvas,arrivu/qibla-ecampus,usmschuck/canvas,narigone/canvas,sfu/canvas-lms,eCNAP/CANVAS,ankithbti/canvas_lms,landonwilkins/canvas-lms,efrj/canvas-lms,ankithbti/canvas_lms,Jyaasa/canvas-lms,wrdsb/canvas-lms,tgroshon/canvas-lms,skmezanul/canvas-lms,fronteerio/canvas-lms,sfu/canvas-lms,va7map/canvas-lms,arrivu/hiring-site,juoni/canvas-lms,dgynn/canvas-lms,arrivu/qibla-ecampus,sfu/canvas-lms,landonwilkins/canvas-lms,instructure/canvas-lms,SwinburneOnline/canvas-lms,narigone/canvas,Jyaasa/canvas-lms,shidao-fm/canvas-lms,djbender/canvas-lms,whalejasmine/canvas-lms,loganrun/pincan,grahamb/canvas-lms,sdeleon28/canvas-lms,parbros/red-innovadores-lms,sfu/canvas-lms,eCNAP/CANVAS,wye0220/shindig-canvas,rup/Tarrax,va7map/canvas-lms,wrdsb/canvas-lms,rup/Tarrax,snehakachroo1/LSI_replica,wrdsb/canvas-lms,ShreniiNepal/shrenii_lmp,Rvor/canvas-lms,loganrun/pincan,tgroshon/canvas-lms,kyroskoh/canvas-lms,tgroshon/canvas-lms,matematikk-mooc/canvas-lms,grahamb/canvas-lms,arrivu/hoodemo,usmschuck/canvas,arrivu/hoodemo,whalejasmine/canvas-lms,ShreniiNepal/shrenii_lmp,sdeleon28/canvas-lms,leftplusrightllc/canvas-lms,venturehive/canvas-lms,utkarshx/canvas-lms,rup/Tarrax,roxolan/canvas-lms,jay3126/canvas-lms,venturehive/canvas-lms,instructure/canvas-lms,greyhwndz/canvas-lms,kyroskoh/canvas-lms,matematikk-mooc/canvas-lms,nditech/red-innovadores-lms,sdeleon28/canvas-lms,nditech/red-innovadores-lms,AndranikMarkosyan/lms,arrivu/qibla-ecampus,antoniuslin/canvas-lms,redconfetti/canvas-lms,usmschuck/canvas,wimemx/Canvas,redconfetti/canvas-lms,juoni/canvas-lms,wrdsb/canvas-lms,redconfetti/canvas-lms,merichar/canvas-lms,arrivu/hiring-site,arrivu/arrivu-lms,va7map/canvas-lms,grahamb/canvas-lms,kyroskoh/canvas-lms,venturehive/canvas-lms,Jyaasa/canvas-lms,Rvor/canvas-lms,gbleydon/canvas-lms,samuels410/greatlakes-lms,efrj/canvas-lms,arrivu/jigsaw-lms,Unow/ins,nditech/red-innovadores-lms,HotChalk/canvas-lms,HotChalk/canvas-lms,AndranikMarkosyan/lms,wye0220/shindig-canvas,juoni/canvas-lms,tgroshon/canvas-lms,sli7246/canvas_branch,utkarshx/canvas-lms,HotChalk/canvas-lms,arrivu/jigsaw-lms,fronteerio/canvas-lms,sdeleon28/canvas-lms,ShreniiNepal/shrenii_lmp,skmezanul/canvas-lms,instructure/canvas-lms,eCNAP/CANVAS,snehakachroo1/LSI_replica,antoniuslin/canvas-lms,SwinburneOnline/canvas-lms,fronteerio/canvas-lms,narigone/canvas,arrivu/arrivu-lms,djbender/canvas-lms,Rvor/canvas-lms,sli7246/canvas_branch,grahamb/canvas-lms,shidao-fm/canvas-lms,landonwilkins/canvas-lms,SwinburneOnline/canvas-lms,gbleydon/canvas-lms,loganrun/pincan,roxolan/canvas-lms,Unow/ins,whalejasmine/canvas-lms,leftplusrightllc/canvas-lms,eCNAP/CANVAS,sfu/canvas-lms,arrivu/hoodemo,juoni/canvas-lms,roxolan/canvas-lms,skmezanul/canvas-lms,SwinburneOnline/canvas-lms,landonwilkins/canvas-lms,ShreniiNepal/shrenii_lmp,instructure/canvas-lms,jay3126/canvas-lms,merichar/canvas-lms,Unow/canvas-lms,venturehive/canvas-lms,grahamb/canvas-lms,snehakachroo1/LSI_replica,ankithbti/canvas_lms,AndranikMarkosyan/lms,nditech/red-innovadores-lms,shidao-fm/canvas-lms,samuels410/greatlakes-lms,greyhwndz/canvas-lms,parbros/red-innovadores-lms,leftplusrightllc/canvas-lms,sfu/canvas-lms,matematikk-mooc/canvas-lms,efrj/canvas-lms,whalejasmine/canvas-lms,snehakachroo1/LSI_replica,instructure/canvas-lms,shidao-fm/canvas-lms,parbros/red-innovadores-lms,jay3126/canvas-lms,sli7246/canvas_branch,jay3126/canvas-lms,antoniuslin/canvas-lms,efrj/canvas-lms,va7map/canvas-lms,arrivu/jigsaw-lms,samuels410/greatlakes-lms,kyroskoh/canvas-lms,arrivu/hiring-site,greyhwndz/canvas-lms,arrivu/arrivu-lms,Rvor/canvas-lms,samuels410/greatlakes-lms,antoniuslin/canvas-lms,roxolan/canvas-lms,fronteerio/canvas-lms,utkarshx/canvas-lms,Unow/canvas-lms,wimemx/Canvas,dgynn/canvas-lms,gbleydon/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,merichar/canvas-lms,narigone/canvas,dgynn/canvas-lms,leftplusrightllc/canvas-lms,instructure/canvas-lms