better --sql mode support (hand-merged and updated, originally from kaye@r1316)
better --sql mode support (hand-merged and updated, originally from kaye@r1316)

git-svn-id: 0fa98e85e4fcc3d91e1978d0d52e9f30fe7b33de@605 516b4451-ceb8-0310-875f-b17149c99682

briandfoy/perlweb,PeterMartini/perlweb,Abigail/perlweb,ajolma/perlweb,ajolma/perlweb,autarch/perlweb,autarch/perlweb,autarch/perlweb,bjakubski/perlweb,alcy/perlweb,bjakubski/perlweb,briandfoy/perlweb,dagolden/perlweb,alcy/perlweb,ajolma/perlweb,briandfoy/perlweb,PeterMartini/perlweb,dagolden/perlweb,bjakubski/perlweb,dagolden/perlweb,Abigail/perlweb,alcy/perlweb,Abigail/perlweb,PeterMartini/perlweb