#7 incorrect comment handling for multiline SQL

closed-fixed
nobody
None
5
2005-08-23
2004-07-13
John V Sichi
No

A pathological example:

select x,
-- a weird comment
y from t;

The multiline handling preserves the comment but strips
out the newlines, so the JDBC driver sees everything
after the -- as comment. This will lead to a syntax
error from the truncated "select x,". (If you use the
non-standard # comment introducer, you'll instead get a
syntax error from JDBC drivers that don't accept that).

I'm going to fix this by stripping out comments as the
multiline SQL string is accumulated.

Discussion

  • John V Sichi
    John V Sichi
    2005-08-23

    • status: open --> closed
     
  • John V Sichi
    John V Sichi
    2005-08-23

    Logged In: YES
    user_id=173374

    I fixed this one a long time ago. I'm closing this but will
    log some related bugs which I didn't fix yet.

     
  • John V Sichi
    John V Sichi
    2005-08-23

    • status: closed --> closed-fixed