support debug mode in sql_prepare()