SQL allows comments like:
select name -- department name
However, sqlline doesn't handle this correctly because
it doesn't strip the comment and it converts the
newline into a space, so what gets sent to the JDBC
"select name -- department name from sales.depts"
which a typical JDBC driver will see as just "select
name" after stripping off the comment.
There are other cases where converting newlines into
spaces causes well-formed SQL to turn into bad SQL.
For example, the SQL standard allows multi-line string
select "My Big Fat "
But the standard requires the newline in between the
So the best fix for both problems (and possibly others
not encountered yet) would be to preserve the newlines.
Log in to post a comment.