[sd2_mr0562] Fix SQL errors.