detect if mysql is in a transaction
detect if mysql is in a transaction

so that things don't asplode if you do something that auto-commits the
transaction, and then AR can neither commit or rollback the transaction
it thinks it's in

Change-Id: I9df10697a255f60155fa256d93675aa8792009be
Reviewed-on: https://gerrit.instructure.com/5943
Reviewed-by: Brian Palmer <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@instructure.com>
Tested-by: Hudson <dfb64870173313a9a7b56f814c8e3b33e268497a@instructure.com>

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