db_insert_id() returned wrong id when $sql_trail=1. Nasty bug resulting in unexpected...