Fix wrong array index in unique indexes for MySql