[fix] fix sql functions