fixed the mysql connection issue and buffer reset reader index problem for large sql queries