sql: increase coverage by adding tests
sql: increase coverage by removing dead code