fixed buffer issue with where query in mysql