Fixing some transaction handling in MySQL with schema alterations