patch to rlm_sql