Fix some sql error