resolved compile issue with mysql 5.6 and added min implementation