fixed IndexExists bug on mysql