5.2 merge

Early 5.2 merge to fix a mysql sql error causing new tables to not be created in the mysql exports.