Menu

#1511 Comments are not considered in placing the cursor at the correct position after an error occured

SQuirreL
open
nobody
None
medium
2022-10-13
2022-10-13
No

When:
issuing an sql statement with an error that has one or several comments before the error position, e.g. (field datumx does not exist):

SELECT id, -- this is a comment that prevents proper positioning
datumx 
FROM dispoeinsaetze

Actual:
the cursor is placed in the wrong position (indicated by |):

SELECT id, -- this |is a comment that prevents proper positioning
datumx 
FROM dispoeinsaetze

Should:
Instead the cursor should be positioned in the right position next to the error, like in the same statement without the comment:

SELECT id,
datumx 
|FROM dispoeinsaetze

Why is this important:
Especially when copying and pasting bigger SQL-statements with comments into SQuirreL it's hard to find the exact error position.

Probable cause:
It looks like the SQL-statement gets cleaned from all comments before issuing to the JDBC-driver. Thus if the driver reports back an error position it can't know about comments. Looks like the position needs to be projected back to the original statement, skipping the comments.

Sidenote:
I have the parameter plugin installed. Don't know if this is related, but some other bug report mentioned it as a cause for a problem with dashes '--' in string literals.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB