first cut off kmig-sql, and a needed fix to kmig