[3.9] Fix some sql compositions