Issue Details (XML | Word | Printable)

Key: CORE-4816
Type: Bug Bug
Status: Open Open
Priority: Trivial Trivial
Assignee: Unassigned
Reporter: Maxim Kuzmin
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Incorrect column in error message for "Unexpected end of command"

Created: 29/May/15 09:48 AM   Updated: 29/May/15 03:33 PM
Component/s: None
Affects Version/s: 2.5.4
Fix Version/s: None

QA Status: No test


 Description  « Hide
Query:
------------------------------------------
SELECT
    T.*
FROM
    (SELECT
       '1'
    FROM
        RDB$DATABASE

-- Comment
-- Comment
-- Comment
-- Comment
------------------------------------------

Prepare failed with message:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Unexpected end of command - line 12, column 9.

Column 9 is wrong, since it is in the middle of a comment.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 29/May/15 10:34 AM
What a useful bug report!!!!

Dmitry Yemanov added a comment - 29/May/15 02:34 PM
Sean, what details do you need?

-- Comme<column-9-is-here>nt

Unexpected end of command is expected to be detected at the end-of-line, i.e. column 11. This means the error message is misleading.

Adriano dos Santos Fernandes added a comment - 29/May/15 02:49 PM
I didn't count the columns, and 11 is wrong as well, so my observation.

We can't report something is lacking on this line after the comment, so it should be in the next (non-existent) line, or before all the comments.

* A simple solution may be append a \n before parse.

So, it's a bug, yes, but this tracker is currently very noise. We have so many artificial bugs, comming from users and internally as well.

* More funny results happens:

SQL> SELECT
CON> T.*
CON> FROM
CON> (SELECT
CON> '1'
CON> FROM
CON> RDB$DATABASE
CON>
CON> -- Comment
CON> -- Comment
CON> -- Comment
CON> -- Comment
CON>
CON>
CON>
CON> ;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 15, column 9
-syntax error