Extend fix for #798 to work across all DB drivers instead of just mysql
7 files changed