fix multiline sql rewrite bug; corresponding test update