A few more MySQL bugs during optimization
Merge branch 'mysql'